org.springframework.web.servlet.view

Class AbstractTemplateViewResolver

    • Constructor Detail

      • AbstractTemplateViewResolver

        public AbstractTemplateViewResolver()
    • Method Detail

      • setExposeRequestAttributes

        public void setExposeRequestAttributes(boolean exposeRequestAttributes)
        Set whether all request attributes should be added to the model prior to merging with the template. Default is "false".
        See Also:
        AbstractTemplateView.setExposeRequestAttributes(boolean)
      • setAllowRequestOverride

        public void setAllowRequestOverride(boolean allowRequestOverride)
        Set whether HttpServletRequest attributes are allowed to override (hide) controller generated model attributes of the same name. Default is "false", which causes an exception to be thrown if request attributes of the same name as model attributes are found.
        See Also:
        AbstractTemplateView.setAllowRequestOverride(boolean)
      • setExposeSessionAttributes

        public void setExposeSessionAttributes(boolean exposeSessionAttributes)
        Set whether all HttpSession attributes should be added to the model prior to merging with the template. Default is "false".
        See Also:
        AbstractTemplateView.setExposeSessionAttributes(boolean)
      • setAllowSessionOverride

        public void setAllowSessionOverride(boolean allowSessionOverride)
        Set whether HttpSession attributes are allowed to override (hide) controller generated model attributes of the same name. Default is "false", which causes an exception to be thrown if session attributes of the same name as model attributes are found.
        See Also:
        AbstractTemplateView.setAllowSessionOverride(boolean)
      • setExposeSpringMacroHelpers

        public void setExposeSpringMacroHelpers(boolean exposeSpringMacroHelpers)
        Set whether to expose a RequestContext for use by Spring's macro library, under the name "springMacroRequestContext". Default is "true".
        See Also:
        AbstractTemplateView.setExposeSpringMacroHelpers(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)