org.springframework.web.servlet.view

Class InternalResourceViewResolver

    • Constructor Detail

      • InternalResourceViewResolver

        public InternalResourceViewResolver(java.lang.String prefix,
                                            java.lang.String suffix)
        A convenience constructor that allows for specifying prefix and suffix as constructor arguments.
        Parameters:
        prefix - the prefix that gets prepended to view names when building a URL
        suffix - the suffix that gets appended to view names when building a URL
        Since:
        4.3
    • Method Detail

      • setAlwaysInclude

        public void setAlwaysInclude(boolean alwaysInclude)
        Specify whether to always include the view rather than forward to it.

        Default is "false". Switch this flag on to enforce the use of a Servlet include, even if a forward would be possible.

        See Also:
        InternalResourceView.setAlwaysInclude(boolean)
      • buildView

        protected AbstractUrlBasedView buildView(java.lang.String viewName)
                                          throws java.lang.Exception
        Description copied from class: UrlBasedViewResolver
        Creates a new View instance of the specified view class and configures it. Does not perform any lookup for pre-defined View instances.

        Spring lifecycle methods as defined by the bean container do not have to be called here; those will be applied by the loadView method after this method returns.

        Subclasses will typically call super.buildView(viewName) first, before setting further properties themselves. loadView will then apply Spring lifecycle methods at the end of this process.

        Overrides:
        buildView in class UrlBasedViewResolver
        Parameters:
        viewName - the name of the view to build
        Returns:
        the View instance
        Throws:
        java.lang.Exception - if the view couldn't be resolved
        See Also:
        UrlBasedViewResolver.loadView(String, java.util.Locale)