View that allows for response context to be rendered as the result
of marshalling by a Marshaller.
The Object to be marshalled is supplied as a parameter in the model and then
detected during response rendering. Users can
either specify a specific entry in the model via the sourceKey
property or have Spring locate the Source object.
| Modifier and Type | Field and Description |
|---|---|
| public static final String | DEFAULT_CONTENT_TYPE
Hides org. |
| private Marshaller | |
| private String |
| Access | Constructor and Description |
|---|---|
| public | |
| public | MarshallingView(Marshaller marshaller)
Constructs a new |
| Modifier and Type | Method and Description |
|---|---|
| protected void | initApplicationContext()
Overrides org. Subclasses can override this for custom initialization behavior. |
| protected boolean | Returns: whether the given value is to be considered as eligiblethe value's key in the model (never modelKey, Object null)the value to check (never value)null)Check whether the given value from the current view's model is eligible
for marshalling through the configured |
| protected Object | Returns: the Object to be marshalled (ornull if none found)the model Map model)Locate the object to be marshalled. |
| protected void | renderMergedOutputModel(Map<String, Object>
combined output Map (never model, HttpServletRequest null),
with dynamic values taking precedence over static attributescurrent HTTP request request, HttpServletResponse current HTTP response response)Implements abstract org. Subclasses must implement this method to actually render the view. |
| public void | |
| public void | setModelKey(String modelKey)
Set the name of the model key that represents the object to be marshalled. |
| DEFAULT_CONTENT_TYPE | back to summary |
|---|---|
| public static final String DEFAULT_CONTENT_TYPE Hides org. Default content type. Overridable as bean property. | |
| marshaller | back to summary |
|---|---|
| private Marshaller marshaller
| |
| modelKey | back to summary |
|---|---|
| private String modelKey
| |
| MarshallingView | back to summary |
|---|---|
| public MarshallingView() Construct a new | |
| MarshallingView | back to summary |
|---|---|
| public MarshallingView(Marshaller marshaller) Constructs a new | |
| initApplicationContext | back to summary |
|---|---|
| protected void initApplicationContext() Overrides org. Doc from org. Subclasses can override this for custom initialization behavior. The default implementation is empty. Called by
| |
| isEligibleForMarshalling | back to summary |
|---|---|
| protected boolean isEligibleForMarshalling(String modelKey, Object value) Check whether the given value from the current view's model is eligible
for marshalling through the configured The default implementation calls
| |
| locateToBeMarshalled | back to summary |
|---|---|
| protected Object locateToBeMarshalled(Map<String, Object> model) throws IllegalStateException Locate the object to be marshalled. The default implementation first attempts to look under the configured model key, if any, before attempting to locate an object of supported type.
| |
| renderMergedOutputModel | back to summary |
|---|---|
| protected void renderMergedOutputModel(Map<String, Object> model, HttpServletRequest request, HttpServletResponse response) throws Exception Implements abstract org. Doc from org. 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.
| |
| setMarshaller | back to summary |
|---|---|
| public void setMarshaller(Marshaller marshaller) Set the | |
| setModelKey | back to summary |
|---|---|
| public void setModelKey(String modelKey) Set the name of the model key that represents the object to be marshalled. If not specified, the model map will be searched for a supported value type.
| |