类 DefaultRequestToViewNameTranslator

  • 所有已实现的接口:
    RequestToViewNameTranslator

    public class DefaultRequestToViewNameTranslator
    extends Object
    implements RequestToViewNameTranslator
    RequestToViewNameTranslator that simply transforms the URI of the incoming request into a view name.

    Can be explicitly defined as the viewNameTranslator bean in a DispatcherServlet context. Otherwise, a plain default instance will be used.

    The default transformation simply strips leading and trailing slashes as well as the file extension of the URI, and returns the result as the view name with the configured prefix and a suffix added as appropriate.

    The stripping of the leading slash and file extension can be disabled using the stripLeadingSlash and 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
    从以下版本开始:
    2.0
    作者:
    Rob Harrop, Juergen Hoeller
    另请参阅:
    RequestToViewNameTranslator, ViewResolver