SpringBoot配置接口WebMvcConfigurer的實(shí)現(xiàn)-創(chuàng)新互聯(lián)

WebMvcConfigurer配置類其實(shí)是Spring內(nèi)部的一種配置方式,采用JavaBean的形式來(lái)代替?zhèn)鹘y(tǒng)的xml配置文件形式進(jìn)行針對(duì)框架個(gè)性化定制?;趈ava-based方式的spring mvc配置,需要?jiǎng)?chuàng)建一個(gè)配置類并實(shí)現(xiàn)WebMvcConfigurer 接口,WebMvcConfigurerAdapter 抽象類是對(duì)WebMvcConfigurer接口的簡(jiǎn)單抽象(增加了一些默認(rèn)實(shí)現(xiàn)),但在在SpringBoot2.0及Spring5.0中WebMvcConfigurerAdapter已被廢棄 。官方推薦直接實(shí)現(xiàn)WebMvcConfigurer或者直接繼承WebMvcConfigurationSupport,方式一實(shí)現(xiàn)WebMvcConfigurer接口(推薦),方式二繼承WebMvcConfigurationSupport類,具體實(shí)現(xiàn)可看這篇文章。https://www.jb51.net/article/174766.htm

成都創(chuàng)新互聯(lián)公司從2013年成立,是專業(yè)互聯(lián)網(wǎng)技術(shù)服務(wù)公司,擁有項(xiàng)目網(wǎng)站制作、網(wǎng)站設(shè)計(jì)網(wǎng)站策劃,項(xiàng)目實(shí)施與項(xiàng)目整合能力。我們以讓每一個(gè)夢(mèng)想脫穎而出為使命,1280元安慶做網(wǎng)站,已為上家服務(wù),為安慶各地企業(yè)和個(gè)人服務(wù),聯(lián)系電話:13518219792
//
// Source code recreated from a .class file by IntelliJ IDEA
// (powered by Fernflower decompiler)
//
 
package org.springframework.web.servlet.config.annotation;
 
import java.util.List;
import org.springframework.format.FormatterRegistry;
import org.springframework.http.converter.HttpMessageConverter;
import org.springframework.validation.MessageCodesResolver;
import org.springframework.validation.Validator;
import org.springframework.web.method.support.HandlerMethodArgumentResolver;
import org.springframework.web.method.support.HandlerMethodReturnValueHandler;
import org.springframework.web.servlet.HandlerExceptionResolver;
 
public interface WebMvcConfigurer {
 void configurePathMatch(PathMatchConfigurer var1);
 
 void configureContentNegotiation(ContentNegotiationConfigurer var1);
 
 void configureAsyncSupport(AsyncSupportConfigurer var1);
 
 void configureDefaultServletHandling(DefaultServletHandlerConfigurer var1);
 
 void addFormatters(FormatterRegistry var1);
 
 void addInterceptors(InterceptorRegistry var1);
 
 void addResourceHandlers(ResourceHandlerRegistry var1);
 
 void addCorsMappings(CorsRegistry var1);
 
 void addViewControllers(ViewControllerRegistry var1);
 
 void configureViewResolvers(ViewResolverRegistry var1);
 
 void addArgumentResolvers(List<HandlerMethodArgumentResolver> var1);
 
 void addReturnValueHandlers(List<HandlerMethodReturnValueHandler> var1);
 
 void configureMessageConverters(List<HttpMessageConverter<?>> var1);
 
 void extendMessageConverters(List<HttpMessageConverter<?>> var1);
 
 void configureHandlerExceptionResolvers(List<HandlerExceptionResolver> var1);
 
 void extendHandlerExceptionResolvers(List<HandlerExceptionResolver> var1);
 
 Validator getValidator();
 
 MessageCodesResolver getMessageCodesResolver();
}

另外有需要云服務(wù)器可以了解下創(chuàng)新互聯(lián)建站muchs.cn,海內(nèi)外云服務(wù)器15元起步,三天無(wú)理由+7*72小時(shí)售后在線,公司持有idc許可證,提供“云服務(wù)器、裸金屬服務(wù)器、高防服務(wù)器、香港服務(wù)器、美國(guó)服務(wù)器、虛擬主機(jī)、免備案服務(wù)器”等云主機(jī)租用服務(wù)以及企業(yè)上云的綜合解決方案,具有“安全穩(wěn)定、簡(jiǎn)單易用、服務(wù)可用性高、性價(jià)比高”等特點(diǎn)與優(yōu)勢(shì),專為企業(yè)上云打造定制,能夠滿足用戶豐富、多元化的應(yīng)用場(chǎng)景需求。

文章標(biāo)題:SpringBoot配置接口WebMvcConfigurer的實(shí)現(xiàn)-創(chuàng)新互聯(lián)
URL鏈接:http://muchs.cn/article40/cdegeo.html

成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供企業(yè)網(wǎng)站制作網(wǎng)站策劃、營(yíng)銷型網(wǎng)站建設(shè)、網(wǎng)站收錄、網(wǎng)站維護(hù)網(wǎng)站建設(shè)

廣告

聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請(qǐng)盡快告知,我們將會(huì)在第一時(shí)間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如需處理請(qǐng)聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時(shí)需注明來(lái)源: 創(chuàng)新互聯(lián)

網(wǎng)站優(yōu)化排名