WebMvcConfigurer配置類其實是Spring內(nèi)部的一種配置方式,采用JavaBean的形式來代替?zhèn)鹘y(tǒng)的xml配置文件形式進行針對框架個性化定制?;趈ava-based方式的spring mvc配置,需要創(chuàng)建一個配置類并實現(xiàn)WebMvcConfigurer 接口,WebMvcConfigurerAdapter 抽象類是對WebMvcConfigurer接口的簡單抽象(增加了一些默認實現(xiàn)),但在在SpringBoot2.0及Spring5.0中WebMvcConfigurerAdapter已被廢棄 。官方推薦直接實現(xiàn)WebMvcConfigurer或者直接繼承WebMvcConfigurationSupport,方式一實現(xiàn)WebMvcConfigurer接口(推薦),方式二繼承WebMvcConfigurationSupport類,具體實現(xiàn)可看這篇文章。https://www.jb51.net/article/174766.htm
成都創(chuàng)新互聯(lián)公司從2013年成立,是專業(yè)互聯(lián)網(wǎng)技術(shù)服務(wù)公司,擁有項目網(wǎng)站制作、網(wǎng)站設(shè)計網(wǎng)站策劃,項目實施與項目整合能力。我們以讓每一個夢想脫穎而出為使命,1280元安慶做網(wǎng)站,已為上家服務(wù),為安慶各地企業(yè)和個人服務(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)建站bm7419.com,海內(nèi)外云服務(wù)器15元起步,三天無理由+7*72小時售后在線,公司持有idc許可證,提供“云服務(wù)器、裸金屬服務(wù)器、高防服務(wù)器、香港服務(wù)器、美國服務(wù)器、虛擬主機、免備案服務(wù)器”等云主機租用服務(wù)以及企業(yè)上云的綜合解決方案,具有“安全穩(wěn)定、簡單易用、服務(wù)可用性高、性價比高”等特點與優(yōu)勢,專為企業(yè)上云打造定制,能夠滿足用戶豐富、多元化的應(yīng)用場景需求。
文章標題:SpringBoot配置接口WebMvcConfigurer的實現(xiàn)-創(chuàng)新互聯(lián)
URL鏈接:http://bm7419.com/article40/cdegeo.html
成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供企業(yè)網(wǎng)站制作、網(wǎng)站策劃、營銷型網(wǎng)站建設(shè)、網(wǎng)站收錄、網(wǎng)站維護、網(wǎng)站建設(shè)
聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請盡快告知,我們將會在第一時間刪除。文章觀點不代表本網(wǎng)站立場,如需處理請聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時需注明來源: 創(chuàng)新互聯(lián)
猜你還喜歡下面的內(nèi)容