Simply transforms the URI of the incoming request into the view name.
Can be explicitly defined as the "viewNameTranslator" bean in a
org.springframework.web.servlet.DispatcherServlet context; else,
a plain default instance will be used.
The default transformation simply strips the leading slash and file
extension of the URI and returns the result as the view name with the
configured
DefaultRequestToViewNameTranslator.setPrefix(String) "prefix" and and
DefaultRequestToViewNameTranslator.setSuffix(String) "suffix" added as appropriate.
The stripping of the leading slash and file extension can be disabled
using the
DefaultRequestToViewNameTranslator.setStripLeadingSlash(boolean) "stripLeadingSlash" and
DefaultRequestToViewNameTranslator.setStripExtension(boolean) "stripExtension" properties,
respectively.
Find below some examples of request to view name translation.
http://localhost:8080/gamecast/display.html -> display
http://localhost:8080/gamecast/displayShoppingCart.html -> displayShoppingCart
http://localhost:8080/gamecast/admin/index.html -> admin/index
author: Rob Harrop since: 2.0 See Also: org.springframework.web.servlet.RequestToViewNameTranslator See Also: org.springframework.web.servlet.ViewResolver |