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.xml.MarshallingView |
Spring-MVC 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.
Constants | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
String | DEFAULT_CONTENT_TYPE | Default content type. |
[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 | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Constructs a new
MarshallingView with no Marshaller set. | |||||||||||
Constructs a new
MarshallingView with the given Marshaller set. |
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Sets the
Marshaller to be used by this view. | |||||||||||
Set the name of the model key that represents the object to be marshalled.
|
Protected Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Subclasses can override this for custom initialization behavior.
| |||||||||||
Locates the object to be marshalled.
| |||||||||||
Subclasses must implement this method to actually render the view.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
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.context.ApplicationContextAware
| |||||||||||
From interface
org.springframework.web.context.ServletContextAware
| |||||||||||
From interface
org.springframework.web.servlet.View
|
Default content type. Overridable as bean property.
Constructs a new MarshallingView
with no Marshaller
set. The marshaller must be set after
construction by invoking setMarshaller(Marshaller)
.
Constructs a new MarshallingView
with the given Marshaller
set.
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.
Subclasses can override this for custom initialization behavior.
The default implementation is empty. Called by
initApplicationContext(org.springframework.context.ApplicationContext)
.
BeansException |
---|
Locates 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
.
model | the model Map |
---|
null
if none found)ServletException | if the model object specified by the model key is not
supported by the marshaller |
---|
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 |
---|