org.springframework.web.servlet.view
Class AbstractTemplateViewResolver

java.lang.Object
  extended byorg.springframework.context.support.ApplicationObjectSupport
      extended byorg.springframework.web.context.support.WebApplicationObjectSupport
          extended byorg.springframework.web.servlet.view.AbstractCachingViewResolver
              extended byorg.springframework.web.servlet.view.UrlBasedViewResolver
                  extended byorg.springframework.web.servlet.view.AbstractTemplateViewResolver
All Implemented Interfaces:
ApplicationContextAware, ViewResolver
Direct Known Subclasses:
FreeMarkerViewResolver, VelocityViewResolver

public class AbstractTemplateViewResolver
extends UrlBasedViewResolver

Abstract base class for template view resolvers like VelocityViewResolver and FreeMarkerViewResolver.

Provides a convenient way to specify AbstractTemplateView's exposure flags for request attributes, session attributes, and Spring's macro helpers.

Since:
1.1
Author:
Juergen Hoeller
See Also:
AbstractTemplateView, VelocityViewResolver, FreeMarkerViewResolver

Field Summary
 
Fields inherited from class org.springframework.web.servlet.view.UrlBasedViewResolver
FORWARD_URL_PREFIX, REDIRECT_URL_PREFIX
 
Fields inherited from class org.springframework.context.support.ApplicationObjectSupport
logger
 
Constructor Summary
AbstractTemplateViewResolver()
           
 
Method Summary
protected  View loadView(String viewName, Locale locale)
          Creates a new instance of the specified view class and configures it.
protected  Class requiredViewClass()
          Return the required type of view for this resolver.
 void setExposeRequestAttributes(boolean exposeRequestAttributes)
          Set whether all request attributes should be added to the model prior to merging with the template.
 void setExposeSessionAttributes(boolean exposeSessionAttributes)
          Set whether all HttpSession attributes should be added to the model prior to merging with the template.
 void setExposeSpringMacroHelpers(boolean exposeSpringMacroHelpers)
          Set whether to expose a RequestContext for use by Spring's macro library, under the name "springBindRequestContext".
 
Methods inherited from class org.springframework.web.servlet.view.UrlBasedViewResolver
createView, getAttributesMap, getCacheKey, initApplicationContext, setAttributes, setAttributesMap, setContentType, setPrefix, setRedirectContextRelative, setRedirectHttp10Compatible, setRequestContextAttribute, setSuffix, setViewClass
 
Methods inherited from class org.springframework.web.servlet.view.AbstractCachingViewResolver
isCache, removeFromCache, resolveViewName, setCache
 
Methods inherited from class org.springframework.web.context.support.WebApplicationObjectSupport
getServletContext, getTempDir, getWebApplicationContext, isContextRequired
 
Methods inherited from class org.springframework.context.support.ApplicationObjectSupport
getApplicationContext, getMessageSourceAccessor, requiredContextClass, setApplicationContext
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractTemplateViewResolver

public AbstractTemplateViewResolver()
Method Detail

requiredViewClass

protected Class requiredViewClass()
Description copied from class: UrlBasedViewResolver
Return the required type of view for this resolver. This implementation returns AbstractUrlBasedView.

Overrides:
requiredViewClass in class UrlBasedViewResolver
See Also:
AbstractUrlBasedView

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)

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)

setExposeSpringMacroHelpers

public void setExposeSpringMacroHelpers(boolean exposeSpringMacroHelpers)
Set whether to expose a RequestContext for use by Spring's macro library, under the name "springBindRequestContext". Default is false.

See Also:
AbstractTemplateView.setExposeSpringMacroHelpers(boolean)

loadView

protected View loadView(String viewName,
                        Locale locale)
                 throws BeansException
Description copied from class: UrlBasedViewResolver
Creates a new instance of the specified view class and configures it. Does not perform any lookup for pre-defined View instances.

Overrides:
loadView in class UrlBasedViewResolver
Throws:
BeansException


Copyright (C) 2003-2004 The Spring Framework Project.