Description
Vijay Natarajan opened SPR-5757 and commented
While I am not averse to having the controllers use annotation based configuration, I would love to see a functionally equivalent XML based routing configuration, for those who would rather not use it. The current model, IMHO, has the following problems:
-
URL mapping is scattered all over the place. If I have 15 controllers, with 10 methods each (and note that there's the issue of each method potentially having a completely different URL that it can match), a newbie would have to look at 150 potential places to map a given URL to the controller action it resolves to. Admittedly, having good conventions and oversight will alleviate this problem, but seems too easy to have things go awry.
-
any changes to the mapping requires a recompile.
-
The same controller method cannot be mapped to multiple urls (or at least I can't figure out how to do it :( ), allowing different views to be driven by the same controller.
-
A somewhat minor thing. There is now way to write a controller w/o Spring dependencies.
Btw, It would be nice to have mappings that are pattern based, such as, a way to map /somepath/{method} to handler SomePathController, method {method}.
http://blog.springsource.com/2009/03/08/rest-in-spring-3-mvc/
Affects: 3.0.5
Attachments:
- ShowRequestMappings.png (34.90 kB)
Issue Links:
- Allow customization of request mappings [SPR-9935] #14568 Allow customization of request mappings
- Allow links to @Controller methods from views without hardcoding URLs [SPR-5779] #10449 Allow links to
@Controller
methods from views without hardcoding URLs - Overloaded @PathVariable based handler methods fail with ambiguity when URL mapping is specified in XML [SPR-7654] #12310 Overloaded
@PathVariable
based handler methods fail with ambiguity when URL mapping is specified in XML ("supersedes")
12 votes, 21 watchers