Spring BlazeDS Integration

Class AmfView

  extended by org.springframework.context.support.ApplicationObjectSupport
      extended by org.springframework.web.context.support.WebApplicationObjectSupport
          extended by org.springframework.web.servlet.view.AbstractView
              extended by org.springframework.flex.http.AmfView
All Implemented Interfaces:
BeanNameAware, ApplicationContextAware, ServletContextAware, View

public class AmfView
extends AbstractView

Spring-MVC 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.

Jeremy Grelle

Field Summary
Fields inherited from class org.springframework.context.support.ApplicationObjectSupport
Fields inherited from interface org.springframework.web.servlet.View
Constructor Summary
Method Summary
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.
Methods inherited from class org.springframework.web.servlet.view.AbstractView
addStaticAttribute, createRequestContext, createTemporaryOutputStream, exposeModelAsRequestAttributes, generatesDownloadContent, getAttributesMap, getBeanName, getContentType, getRequestContextAttribute, getStaticAttributes, render, setAttributes, setAttributesCSV, setAttributesMap, setBeanName, setContentType, setRequestContextAttribute, toString, writeToResponse
Methods inherited from class org.springframework.web.context.support.WebApplicationObjectSupport
getServletContext, getTempDir, getWebApplicationContext, initApplicationContext, initServletContext, isContextRequired, setServletContext
Methods inherited from class org.springframework.context.support.ApplicationObjectSupport
getApplicationContext, getMessageSourceAccessor, initApplicationContext, requiredContextClass, setApplicationContext
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Field Detail


public static final String DEFAULT_CONTENT_TYPE
See Also:
Constant Field Values
Constructor Detail


public AmfView()
Method Detail


public Set<String> getRenderedAttributes()
Returns the attributes in the model that should be rendered by this view.


public void setRenderedAttributes(Set<String> renderedAttributes)
Sets the attributes in the model that should be rendered by this view. When set, all other model attributes will be ignored.


public void setDisableCaching(boolean disableCaching)
Disables caching of the generated AMF response.

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

Specified by:
renderMergedOutputModel in class AbstractView


protected Object filterModel(Map<String,Object> model)
Filters out undesired attributes from the given model. The return value can be either another 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, javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)
the object to be rendered

Spring BlazeDS Integration

Copyright © 2011. All Rights Reserved.