Skip to content

Externalized request mapping as a 1st class alternative to @RequestMapping [SPR-5757] #10427

Closed
@spring-projects-issues

Description

@spring-projects-issues

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:

  1. 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.

  2. any changes to the mapping requires a recompile.

  3. 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.

  4. 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:

Issue Links:

12 votes, 21 watchers

Metadata

Metadata

Assignees

Labels

has: votes-jiraIssues migrated from JIRA with more than 10 votes at the time of importin: webIssues in web modules (web, webmvc, webflux, websocket)status: declinedA suggestion or change that we don't feel we should currently applytype: enhancementA general enhancement

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions