国产亚洲精品福利在线无卡一,国产精久久一区二区三区,亚洲精品无码国模,精品久久久久久无码专区不卡

當(dāng)前位置: 首頁 > news >正文

企業(yè)管理網(wǎng)站開發(fā)論文可以營銷的十大產(chǎn)品

企業(yè)管理網(wǎng)站開發(fā)論文,可以營銷的十大產(chǎn)品,臨西網(wǎng)站建設(shè),綿陽建設(shè)局官方網(wǎng)站Springboot在web層的開發(fā)基本都是采用Springmvc框架技術(shù),但是Springmvc中的某些配置在boot是沒有的,我們就應(yīng)該根據(jù)自己的需求進(jìn)行對(duì)mvc擴(kuò)展配置 Springboot1.x版本如何配置 通過注解Configuration一個(gè)類,繼承webmvcconfigureradapter&#…

Springboot在web層的開發(fā)基本都是采用Springmvc框架技術(shù),但是Springmvc中的某些配置在boot是沒有的,我們就應(yīng)該根據(jù)自己的需求進(jìn)行對(duì)mvc擴(kuò)展配置

Springboot1.x版本如何配置


通過注解@Configuration一個(gè)類,繼承webmvcconfigureradapter,然后根據(jù)需求實(shí)現(xiàn)里面的方法。

Springboot2.x版本如何配置

通過實(shí)現(xiàn)webmvcconfigure接口的方式

上面boot對(duì)mvc的擴(kuò)展配置既保留了mvc的默認(rèn)配置,也可以使用我們擴(kuò)展的配置。如何全面接管mvc的配置,所以的webmvc都由我們自己配置?只需要加上注解EnableWebMvc

擴(kuò)展配置使用舉例,如配置攔截器

import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.HandlerInterceptor;
import org.springframework.web.servlet.ModelAndView;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;/*** 自定義一個(gè)登陸攔截器*/
@Configuration //聲明這是一個(gè)配置
public class LoginInterceptor extends WebMvcConfigurerAdapter {/*用來添加攔截器的方法InterceptorRegistry registry攔截器注冊(cè)*/@Overridepublic void addInterceptors(InterceptorRegistry registry) {//使用匿名內(nèi)部類創(chuàng)建要給攔截器HandlerInterceptor loginInterceptor = new HandlerInterceptor() {@Overridepublic boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object o) throws Exception {//判斷session中是否存在用戶if (request.getSession().getAttribute("user") == null) {response.sendRedirect("/admin");return false;}return true;}@Overridepublic void postHandle(HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse, Object o, ModelAndView modelAndView) throws Exception {}@Overridepublic void afterCompletion(HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse, Object o, Exception e) throws Exception {}};registry.addInterceptor(loginInterceptor).addPathPatterns("/admin/**").excludePathPatterns("/admin").excludePathPatterns("/admin/login");}
}

tomcat配置


Springboot默認(rèn)使用的就是嵌入式servlet容器即tomcat,對(duì)于web項(xiàng)目,如果使用的是外部tomcat,相關(guān)配置比如訪問端口、資源路徑等可以在tomcat的conf文件下配置。但是在boot中,tomcat配置又兩種方式

第一種:通過配置文件直接配置(推薦)
?

#如果是tomcat相關(guān)的設(shè)置用server.tomcat.xx
server.tomcat.uri-encoding=UTF-8
#如果是servlet相關(guān)的配置用server.xx
server.port=80

?第二種:通過配置類的方式

http://www.aloenet.com.cn/news/32071.html

相關(guān)文章:

  • 唐山seo快速排名seo全稱是什么
  • 汕頭百度網(wǎng)站建設(shè)成都網(wǎng)絡(luò)營銷品牌代理機(jī)構(gòu)
  • 織夢(mèng)修改網(wǎng)站后備份網(wǎng)絡(luò)軟文
  • 搭建平臺(tái)暢通渠道網(wǎng)站seo推廣
  • 自己做網(wǎng)絡(luò)棋牌網(wǎng)站流程泉州seo報(bào)價(jià)
  • 商城網(wǎng)站建設(shè)招聘百度搜索風(fēng)云榜總榜
  • 網(wǎng)站app開發(fā)平臺(tái)網(wǎng)站搭建谷歌seo
  • wordpress插件裝多了卡seo代碼優(yōu)化包括哪些
  • 巴中網(wǎng)站建設(shè)免費(fèi)自助建站網(wǎng)站
  • 煙臺(tái)seo網(wǎng)站診斷短視頻營銷推廣方式
  • 南寧美容網(wǎng)站建設(shè)seo智能優(yōu)化公司
  • php動(dòng)態(tài)網(wǎng)站怎么做商旅100網(wǎng)頁版
  • 做地方門戶網(wǎng)站如何做可靠的網(wǎng)站優(yōu)化
  • 怎么自己做網(wǎng)站發(fā)優(yōu)惠券seo搜索引擎優(yōu)化業(yè)務(wù)
  • 佛山電商網(wǎng)站制作seo自學(xué)教程
  • 租網(wǎng)站服務(wù)器價(jià)格seo霸屏
  • 網(wǎng)頁與網(wǎng)站設(shè)計(jì)nbsp的意思合肥做網(wǎng)站哪家好
  • 做家庭影院的有哪些網(wǎng)站防城港網(wǎng)站seo
  • 環(huán)保企業(yè)的網(wǎng)站怎么做指數(shù)基金是什么意思
  • seo外包 靠譜長沙seo咨詢
  • 網(wǎng)站二維碼鏈接怎么做的遼陽網(wǎng)站seo
  • 筑巢網(wǎng)站百度地圖廣告投放
  • 網(wǎng)站建設(shè)需要域名嗎鄭州seo網(wǎng)站有優(yōu)化
  • 外賣網(wǎng)站制作seo 關(guān)鍵詞優(yōu)化
  • 想做一個(gè)部門的網(wǎng)站怎么做頭條熱點(diǎn)新聞
  • 公司手機(jī)網(wǎng)站模板優(yōu)化大師win10下載
  • 手機(jī)如果做網(wǎng)站市場調(diào)研方案怎么寫
  • 網(wǎng)站開發(fā)工程師社交百度代發(fā)收錄
  • 做局域網(wǎng)網(wǎng)站百度圖片識(shí)別搜索引擎
  • szfob外貿(mào)論壇網(wǎng)站重慶seo推廣公司