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 |
Known Direct Subclasses |
Known Indirect Subclasses |
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.
Constants | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
String | SPRING_MACRO_REQUEST_CONTEXT_ATTRIBUTE | Variable name of the RequestContext instance in the template model, available to Spring's macros: e.g. |
[Expand]
Inherited Constants | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
org.springframework.web.servlet.view.AbstractView
|
[Expand]
Inherited Fields | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
org.springframework.context.support.ApplicationObjectSupport
| |||||||||||
From interface
org.springframework.web.servlet.View
|
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Set whether HttpServletRequest attributes are allowed to override (hide)
controller generated model attributes of the same name.
| |||||||||||
Set whether HttpSession attributes are allowed to override (hide)
controller generated model attributes of the same name.
| |||||||||||
Set whether all request attributes should be added to the
model prior to merging with the template.
| |||||||||||
Set whether all HttpSession attributes should be added to the
model prior to merging with the template.
| |||||||||||
Set whether to expose a RequestContext for use by Spring's macro library,
under the name "springMacroRequestContext".
|
Protected Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Apply this view's content type as specified in the "contentType"
bean property to the given response.
| |||||||||||
Subclasses must implement this method to actually render the view.
| |||||||||||
Subclasses must implement this method to actually render the view.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
org.springframework.web.servlet.view.AbstractUrlBasedView
| |||||||||||
From class
org.springframework.web.servlet.view.AbstractView
| |||||||||||
From class
org.springframework.web.context.support.WebApplicationObjectSupport
| |||||||||||
From class
org.springframework.context.support.ApplicationObjectSupport
| |||||||||||
From class
java.lang.Object
| |||||||||||
From interface
org.springframework.beans.factory.BeanNameAware
| |||||||||||
From interface
org.springframework.beans.factory.InitializingBean
| |||||||||||
From interface
org.springframework.context.ApplicationContextAware
| |||||||||||
From interface
org.springframework.web.context.ServletContextAware
| |||||||||||
From interface
org.springframework.web.servlet.View
|
Variable name of the RequestContext instance in the template model, available to Spring's macros: e.g. for creating BindStatus objects.
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.
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.
Set whether all request attributes should be added to the model prior to merging with the template. Default is "false".
Set whether all HttpSession attributes should be added to the model prior to merging with the template. Default is "false".
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.
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.
response | current HTTP response |
---|
Subclasses must implement this method to actually render the view.
The first step will be preparing the request: In the JSP case, this would mean setting model objects as request attributes. The second step will be the actual rendering of the view, for example including the JSP via a RequestDispatcher.
model | combined output Map (never null ),
with dynamic values taking precedence over static attributes |
---|---|
request | current HTTP request |
response | current HTTP response |
Exception |
---|
Subclasses must implement this method to actually render the view.
model | combined output Map, with request attributes and session attributes merged into it if required |
---|---|
request | current HTTP request |
response | current HTTP response |
Exception | if rendering failed |
---|