Description
Chris Herron opened SPR-5779 and commented
The various Spring Web tags and template-URI implementation encourage hard-coding of URLs in the view layer.
If I alter a Controller's URL mapping, I need to remember to go and make the corresponding change(s) in my JSPs so that links and forms aren't broken.
If the spring:url and form:form tags were able to accept the FQCN of a controller bean instead of an actual URL, the tag implementation could determine the most appropriate URL mapping, and (if applicable) incorporate any template-URI params / path variables to generate a reliable URL.
By using the the FQCN, we can rely on any modern IDE to locate references during refactoring, instead of requiring additional help from Spring-aware IDE plugins. IMHO this would fit particularly well with Spring 3.0's annotation-based controller configuration.
Stripes supports this approach:
http://stripes.sourceforge.net/docs/current/taglib/stripes/link.html
http://stripes.sourceforge.net/docs/current/taglib/stripes/form.html
Affects: 3.0 M3
Reference URL: http://forum.springsource.org/showthread.php?t=72284
Issue Links:
- URI/URL Related Improvement Suggestions for RequestMapping in Spring MVC [SPR-7585] #12241 URI/URL Related Improvement Suggestions for RequestMapping in Spring MVC ("is duplicated by")
- Externalized request mapping as a 1st class alternative to @RequestMapping [SPR-5757] #10427 Externalized request mapping as a 1st class alternative to
@RequestMapping
- Form tag should prepend the contextPath and servletPath if not present [SPR-8684] #13326 Form tag should prepend the contextPath and servletPath if not present
Referenced from: commits 6b129c5, 9d479fe
32 votes, 29 watchers