I need to extend the WebMvcConfigurationSupport class to change two things:
@Configuration public class WebConfig extends WebMvcConfigurationSupport { @Override public RequestMappingHandlerMapping requestMappingHandlerMapping() { RequestMappingHandlerMapping handlerMapping = super.requestMappingHandlerMapping(); handlerMapping.setRemoveSemicolonContent(false); handlerMapping.setOrder(1); return handlerMapping; } }
I like the default values โโregistered from the WebMvcAutoConfiguration class, but due to the conditional annotation to the class, when I extend the WebMvcConfigurationSupport class, it prevents automatic configuration.
@Configuration @ConditionalOnWebApplication @ConditionalOnClass({ Servlet.class, DispatcherServlet.class, WebMvcConfigurerAdapter.class }) @ConditionalOnMissingBean(WebMvcConfigurationSupport.class) @Order(Ordered.HIGHEST_PRECEDENCE + 10) @AutoConfigureAfter(DispatcherServletAutoConfiguration.class) public class WebMvcAutoConfiguration {...}
Do I need to load the class class WebMvcAutoConfiguration without having to essentially copy / paste most of the code in this class?
Or you can call RequestMappingHandlerMapping setOrder () and setRemoveSemicolonContent () from another place, so I can just use the @EnableWebMvc annotation and run the autoconfiguration class without any problems?
Thanks in advance!
java spring spring-boot spring-mvc
Cory Comer Mar 08 '14 at 8:50 2014-03-08 08:50
source share