Save This Page
Home » spring-framework-2.5.5-with-dependencies » org.springframework » web » servlet » view » [javadoc | source]
org.springframework.web.servlet.view
abstract public class: AbstractTemplateView [javadoc | source]
java.lang.Object
   org.springframework.context.support.ApplicationObjectSupport
      org.springframework.web.context.support.WebApplicationObjectSupport
         org.springframework.web.servlet.view.AbstractView
            org.springframework.web.servlet.view.AbstractUrlBasedView
               org.springframework.web.servlet.view.AbstractTemplateView

All Implemented Interfaces:
    InitializingBean, View, BeanNameAware, ServletContextAware, ApplicationContextAware

Direct Known Subclasses:
    FreeMarkerView, VelocityToolboxView, VelocityLayoutView, VelocityView

Adapter base class for template-based view technologies such as Velocity and FreeMarker, with the ability to use request and session attributes in their model and the option to expose helper objects for Spring's Velocity/FreeMarker macro library.

JSP/JSTL and other view technologies automatically have access to the HttpServletRequest object and thereby the request/session attributes for the current user. Furthermore, they are able to create and cache helper objects as request attributes themselves.

Field Summary
public static final  String SPRING_MACRO_REQUEST_CONTEXT_ATTRIBUTE    Variable name of the RequestContext instance in the template model, available to Spring's macros: e.g. for creating BindStatus objects. 
Fields inherited from org.springframework.web.servlet.view.AbstractView:
DEFAULT_CONTENT_TYPE
Fields inherited from org.springframework.context.support.ApplicationObjectSupport:
logger
Method from org.springframework.web.servlet.view.AbstractTemplateView Summary:
applyContentType,   renderMergedOutputModel,   renderMergedTemplateModel,   setAllowRequestOverride,   setAllowSessionOverride,   setExposeRequestAttributes,   setExposeSessionAttributes,   setExposeSpringMacroHelpers
Methods from org.springframework.web.servlet.view.AbstractUrlBasedView:
afterPropertiesSet,   getUrl,   isUrlRequired,   setUrl,   toString
Methods from org.springframework.web.servlet.view.AbstractView:
addStaticAttribute,   createRequestContext,   createTemporaryOutputStream,   exposeModelAsRequestAttributes,   generatesDownloadContent,   getAttributesMap,   getBeanName,   getContentType,   getRequestContextAttribute,   getStaticAttributes,   prepareResponse,   render,   renderMergedOutputModel,   setAttributes,   setAttributesCSV,   setAttributesMap,   setBeanName,   setContentType,   setRequestContextAttribute,   toString,   writeToResponse
Methods from org.springframework.web.context.support.WebApplicationObjectSupport:
getServletContext,   getTempDir,   getWebApplicationContext,   initApplicationContext,   initServletContext,   isContextRequired,   setServletContext
Methods from org.springframework.context.support.ApplicationObjectSupport:
getApplicationContext,   getMessageSourceAccessor,   initApplicationContext,   initApplicationContext,   isContextRequired,   requiredContextClass,   setApplicationContext
Methods from java.lang.Object:
equals,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from org.springframework.web.servlet.view.AbstractTemplateView Detail:
 protected  void applyContentType(HttpServletResponse response) 
    Apply this view's content type as specified in the "contentType" bean property to the given response.

    When running on Servlet 2.4, only applies the view's contentType if no content type has been set on the response before. This allows handlers to override the default content type beforehand.

 protected final  void renderMergedOutputModel(Map model,
    HttpServletRequest request,
    HttpServletResponse response) throws Exception 
 abstract protected  void renderMergedTemplateModel(Map model,
    HttpServletRequest request,
    HttpServletResponse response) throws Exception
    Subclasses must implement this method to actually render the view.
 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.
 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.
 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".
 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".
 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".

    Currently needed for Spring's Velocity and FreeMarker default macros. Note that this is not required for templates that use HTML forms unless you wish to take advantage of the Spring helper macros.