Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>You can do what you're trying to do by simply omitting the view name, as long as your views match up with your URLs. If you don't provide a view name, Spring will use a RequestToViewNameTranslator to try to figure out a view name. You can look at the source for that class to see exactly how it work. Here's a good quote from the docs:</p> <p>"... a request URL of '<a href="http://localhost/registration.html" rel="nofollow noreferrer">http://localhost/registration.html</a>' will result in a logical view name of 'registration' being generated by the DefaultRequestToViewNameTranslator. This logical view name will then be resolved into the '/WEB-INF/jsp/registration.jsp' view by the InternalResourceViewResolver bean."</p> <p>So it could, for example, make it so that a controller method handling "/modules/tips" would by default try to use a view named "modules/tips", presumably you would have a JSP at "/WEB-INF/jsp/modules/tips.jsp". </p> <p><a href="http://static.springsource.org/spring/docs/3.0.x/spring-framework-reference/html/mvc.html#mvc-coc-r2vnt" rel="nofollow noreferrer">http://static.springsource.org/spring/docs/3.0.x/spring-framework-reference/html/mvc.html#mvc-coc-r2vnt</a></p> <p>EDIT: I just noticed that you said you tried omitting the view name, and it didn't seem like that worked. You could always write your own implementation of the RequestToViewNameTranslator and replace the DefaultRequestToViewNameTranslator with your own custom implentation. Check the docs for how to inject your own translator.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload