| |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
org.springframework.context.support.ApplicationObjectSupport
|
+--org.springframework.web.context.support.WebApplicationObjectSupport
|
+--org.springframework.web.servlet.view.AbstractView
Abstract view superclass. Standard framework view implementations and application-specific custom views can extend this class to simplify their implementation. Subclasses should be JavaBeans.
Extends ApplicationObjectSupport, which will be helpful to some views. Handles static attributes, and merging static with dynamic attributes. Subclasses just need to implement the actual rendering.
It's recommended that subclasses don't cache anything, in the quest for efficiency. This class offers caching. However, it's possible to disable this class's caching, which is useful during development.
| Method Summary | |
final void | addStaticAttribute(String name, Object value)Add static data to this view, exposed in each view. |
final String | getBeanName()Return the view's name. |
final Map | getStaticAttributes()Handy for testing. |
void | render(Map model, HttpServletRequest request, HttpServletResponse response)Prepares the view given the specified model, merging it with static attributes and a RequestContext attribute, if necessary. |
final void | setAttributes(Properties props)Set static attributes from a java.util.Properties object. |
final void | setAttributesCSV(String propString)Set static attributes as a CSV string. |
final void | setAttributesMap(Map attributes)Set static attributes from a Map. |
final void | setBeanName(String beanName)Set the view's name. |
final void | setContentType(String contentType)Set the content type for this view. |
final void | setRequestContextAttribute(String requestContextAttribute)Set the name of the RequestContext attribute for this view, or null if not needed. |
| Methods inherited from class org.springframework.context.support.ApplicationObjectSupport |
getApplicationContext, setApplicationContext |
| Method Detail |
public final void addStaticAttribute(String name, Object value)
Must be invoked before any calls to render().
public final String getBeanName()
public final Map getStaticAttributes()
public void render(Map model, HttpServletRequest request, HttpServletResponse response)
throws java.lang.Exception
public final void setAttributes(Properties props)
Can be populated with a String "value" (parsed via PropertiesEditor) or a "props" element in XML bean definitions.
public final void setAttributesCSV(String propString)
throws java.lang.IllegalArgumentException
public final void setAttributesMap(Map attributes)
Can be populated with a "map" or "props" element in XML bean definitions.
public final void setBeanName(String beanName)
public final void setContentType(String contentType)
public final void setRequestContextAttribute(String requestContextAttribute)
| Association Links |
to Class java.lang.String
to Class java.lang.String
to Class java.util.Map
| |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||