I'm overriding the "default" instantiated DefaultAnnotationHandlerMapping explicitly for registering additional interceptors like this:
But strangely and according to the logs I end up with actually *2* instances of DefaultAnnotationHandlerMappings. So the implicit (default) one is obviously not replaced by the explicitly defined one (which it should hoever according to the docs).
I pinned down that the source of this behaviour seems to be in the <mvc:annotation-driven> directive which I have as well in my configuration for using JSR 303 validation with hibernate validator. When I remove this piece of xml the explicit DefaultAnnotationHandlerMapping wins and the default one is gone (plus the interception for the locale works then - it did not before as the implicit DefaultAnnotationHandlerMappings did not have the interceptor registered at all).
Bug ? Or why should the annotation-driven thing have an impact on changing the override-behavior of the handler mappings ?
Best Regards,
Alex
PS: I'm talking about MVC 3.0.0 RC2 here....
Code:
<bean class="org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping"> <property name="alwaysUseFullPath" value="false"/> <property name="interceptors"> <list> <ref local="localeChangeInterceptor"/> </list> </property> </bean>
I pinned down that the source of this behaviour seems to be in the <mvc:annotation-driven> directive which I have as well in my configuration for using JSR 303 validation with hibernate validator. When I remove this piece of xml the explicit DefaultAnnotationHandlerMapping wins and the default one is gone (plus the interception for the locale works then - it did not before as the implicit DefaultAnnotationHandlerMappings did not have the interceptor registered at all).
Bug ? Or why should the annotation-driven thing have an impact on changing the override-behavior of the handler mappings ?
Best Regards,
Alex
PS: I'm talking about MVC 3.0.0 RC2 here....
Comment