Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.Sign up
Add mvc namespace for simplifying setup of Spring MVC [SPR-6306] #10972
Spring MVC setup could be simplified considerably by adding a custom XML namespace. A simple tag to configure mvc:annotated-controllers/ with reasonable default settings would be a great start.
AFTER MVC NAMESPACE
BEFORE MVC NAMESPACE
Affects: 3.0 RC1
1 votes, 3 watchers
Alex Rau commented
I think this feature breaks or at least is not conforming to the implemented strategy in MVC that there is an implicit DefaultAnnotationHandlerMapping (D1) which can be replaced with custom parameterized versions (D2) of handler mappings.
As soon as someone wants to use the above short-cut "mvc:annotation-driven" there will be a DefaultAnnotationHandlerMapping (D3) which a) cannot be replaced with a custom version (D2) anymore and b) replaces the implicit one (D1). Even worse - developers declaring (D3) assuming they would override the implicit one (D1) will end up with two instances of DefaultAnnotationHandlerMapping (D2 and D3) resulting in duplicate registration of annotated controllers (component scan) and custom parameterization which will be without any effect as D2 seems to win over D3.
I think at least a dedicated property for the above declaration should be defined which allows passing in a custom DefaultAnnotationHandlerMapping along with the declaration (+ some clarifying documentation about this wouldn't be too bad).