Hello,
What happened to #spring? Anyway...
Is there a sensible way to set RequestMappingHandlerMapping.useSuffixPatternMatch to false when I using <mvc:annotation-driven> in the XML config?
This is for Spring 3.1 by the way.
Cheers,
M
Hello,
What happened to #spring? Anyway...
Is there a sensible way to set RequestMappingHandlerMapping.useSuffixPatternMatch to false when I using <mvc:annotation-driven> in the XML config?
This is for Spring 3.1 by the way.
Cheers,
M
The MVC Java config in Spring 3.1 provides the same benefits the the MVC namespace but also makes it easier to customize properties on the underlying beans:
See the Javadoc on @EnableWebMvc or the reference documentation for more details.Code:@Configuration public class WebConfig extends WebMvcConfigurationSupport { @Override @Bean public RequestMappingHandlerMapping requestMappingHandlerMapping() { RequestMappingHandlerMapping hm = super.requestMappingHandlerMapping(); hm.setSuffixPatternMatch(false); return hm; } }
I tried this approach with the application that is configured using XML and I removed annotation-driven from it and added @EnableWebMvc annotated configuration class and this works fine.
Is this good approach to mix XML and JAVA configurations? Some of the mvc configuration (interceptors, view resolvers) are in XML, some in JAVA config.
What's your opinion?