public class AmfView extends AbstractView
View
that renders AMF content by serializing the model for the current request using
BlazeDS's AMF serialization/deserialization APIs.
By default, the entire contents of the model map (with the exception of framework-specific classes) will be
encoded as AMF. For cases where the contents of the map need to be filtered, users may specify a specific set of
model attributes to encode via the renderedAttributes
property.
Modifier and Type | Field and Description |
---|---|
static String |
DEFAULT_CONTENT_TYPE |
logger
PATH_VARIABLES, RESPONSE_STATUS_ATTRIBUTE, SELECTED_CONTENT_TYPE
Constructor and Description |
---|
AmfView() |
Modifier and Type | Method and Description |
---|---|
protected Object |
filterModel(Map<String,Object> model)
Filters out undesired attributes from the given model.
|
Set<String> |
getRenderedAttributes()
Returns the attributes in the model that should be rendered by this view.
|
protected void |
prepareResponse(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response) |
protected void |
renderMergedOutputModel(Map<String,Object> model,
javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response) |
void |
setDisableCaching(boolean disableCaching)
Disables caching of the generated AMF response.
|
void |
setRenderedAttributes(Set<String> renderedAttributes)
Sets the attributes in the model that should be rendered by this view.
|
addStaticAttribute, createMergedOutputModel, createRequestContext, createTemporaryOutputStream, exposeModelAsRequestAttributes, generatesDownloadContent, getAttributesMap, getBeanName, getContentType, getRequestContextAttribute, getRequestToExpose, getStaticAttributes, isExposePathVariables, render, setAttributes, setAttributesCSV, setAttributesMap, setBeanName, setContentType, setExposeContextBeansAsAttributes, setExposedContextBeanNames, setExposePathVariables, setRequestContextAttribute, setResponseContentType, toString, writeToResponse
getServletContext, getTempDir, getWebApplicationContext, initApplicationContext, initServletContext, isContextRequired, setServletContext
getApplicationContext, getMessageSourceAccessor, initApplicationContext, requiredContextClass, setApplicationContext
public static final String DEFAULT_CONTENT_TYPE
public Set<String> getRenderedAttributes()
public void setRenderedAttributes(Set<String> renderedAttributes)
public void setDisableCaching(boolean disableCaching)
Default is true
, which will prevent the client from caching the generated AMF response.
protected void prepareResponse(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
prepareResponse
in class AbstractView
protected void renderMergedOutputModel(Map<String,Object> model, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws Exception
renderMergedOutputModel
in class AbstractView
Exception
protected Object filterModel(Map<String,Object> model)
Map
, or a
single value object. If only a single attribute is present in the model map, that value will be returned instead
of the full map.
Default implementation removes BindingResult
instances and entries not included in the renderedAttributes
property.
model
- the model, as passed on to renderMergedOutputModel(java.util.Map<java.lang.String, java.lang.Object>, javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)
Copyright © 2014. All rights reserved.