Issue Details (XML | Word | Printable)

Key: SPR-4125
Type: Improvement Improvement
Status: Resolved Resolved
Resolution: Fixed
Priority: Major Major
Assignee: Juergen Hoeller
Reporter: Chris Lee
Votes: 0
Watchers: 1
Operations

If you were logged in you would be able to see more operations.
Spring Framework

Add convention-over-configuration support for @RequestMapping

Created: 19/Nov/07 10:42 AM   Updated: 05/Aug/08 09:07 AM
Component/s: SpringWEB
Affects Version/s: 2.5 RC2
Fix Version/s: 2.5.2

Time Tracking:
Not Specified

Environment: n/a
Issue Links:
Related
 


 Description  « Hide
DefaultAnnotationHandlerMapping presently takes the URLs directly from the @RequestMapping annotation; this could be strategized to build the URLs based on known data at that time, i.e. class name, etc.

For @RequestMapping at the type level, the semantics would be the same as ControllerClassNameHandlerMapping. At the method level, presumably the method name could be appended to the path determined by the enclosing type.


 All   Comments   Work Log   Change History   FishEye   Builds      Sort Order: Ascending order - Click to sort in descending order
Juergen Hoeller added a comment - 05/Aug/08 08:40 AM
This already works to quite some degree, at least since Spring 2.5.2: through a combination of ControllerClassNameHandlerMapping and @RequestMapping annotations at the method level (without hardcoding paths there). In this case, the type-level mapping will be derived from the controller class name, with a relative mapping for each handler method appended based on the method name. The file suffix, if contained in the URI, is irrelevant in this case, as long as the final path matches the name of the handler method.

We will revisit this in Spring 3.0 for some more fully realized RESTful conventions.

Juergen