HandlerMethodArgumentResolvers and
HandlerMethodReturnValueHandlers during the course of invocation of
a controller method.
The setRequestHandled flag can be used to indicate the request
has been handled directly and view resolution is not required.
A default Model is automatically created at instantiation.
An alternate model instance may be provided via setRedirectModel
for use in a redirect scenario. When setRedirectModelScenario is set
to true signaling a redirect scenario, the getModel()
returns the redirect model instead of the default model.
| Modifier and Type | Field and Description |
|---|---|
| private final Set | |
| private final ModelMap | |
| private boolean | |
| private final Set | |
| private ModelMap | |
| private boolean | |
| private boolean | |
| private final SessionStatus | |
| private HttpStatusCode | |
| private Object |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public ModelAndViewContainer | |
| public ModelAndViewContainer | |
| public ModelAndViewContainer | |
| public boolean | |
| public ModelMap | Returns: the default model (nevernull)Return the "default" model created at instantiation. |
| public ModelMap | |
| public SessionStatus | getSessionStatus()
Return the |
| public HttpStatusCode | |
| public Object | getView()
Return the View object, or |
| public String | getViewName()
Return the view name to be resolved by the DispatcherServlet via a
ViewResolver, or |
| public boolean | |
| public boolean | |
| public boolean | isViewReference()
Whether the view is a view reference specified via a name to be resolved by the DispatcherServlet via a ViewResolver. |
| public ModelAndViewContainer | mergeAttributes(Map<String, ?> attributes)
Copy attributes in the supplied |
| public ModelAndViewContainer | |
| public void | setBinding(String
the name of the attribute attributeName, boolean enabled)Register whether data binding should occur for a corresponding model attribute,
corresponding to an |
| public void | setBindingDisabled(String
the name of the attribute attributeName)Programmatically register an attribute for which data binding should not occur,
not even for a subsequent |
| public void | setIgnoreDefaultModelOnRedirect(boolean ignoreDefaultModelOnRedirect)
Deprecated
since 6.0. as of 6.0 without a replacement; once removed, the default
model will always be ignored on redirect
By default, the content of the "default" model is used both during
rendering and redirect scenarios.
|
| public void | setRedirectModel(ModelMap redirectModel)
Provide a separate model instance to use in a redirect scenario. |
| public void | setRedirectModelScenario(boolean redirectModelScenario)
Whether the controller has returned a redirect instruction, e.g. a "redirect:" prefixed view name, a RedirectView instance, etc. |
| public void | setRequestHandled(boolean requestHandled)
Whether the request has been handled fully within the handler, e.g.
|
| public void | setStatus(HttpStatusCode status)
Provide an HTTP status that will be passed on to with the
|
| public void | |
| public void | setViewName(String viewName)
Set a view name to be resolved by the DispatcherServlet via a ViewResolver. |
| public String | |
| private boolean |
| bindingDisabled | back to summary |
|---|---|
| private final Set<String> bindingDisabled | |
| defaultModel | back to summary |
|---|---|
| private final ModelMap defaultModel | |
| ignoreDefaultModelOnRedirect | back to summary |
|---|---|
| private boolean ignoreDefaultModelOnRedirect | |
| noBinding | back to summary |
|---|---|
| private final Set<String> noBinding | |
| redirectModel | back to summary |
|---|---|
| private ModelMap redirectModel
| |
| redirectModelScenario | back to summary |
|---|---|
| private boolean redirectModelScenario | |
| requestHandled | back to summary |
|---|---|
| private boolean requestHandled | |
| sessionStatus | back to summary |
|---|---|
| private final SessionStatus sessionStatus | |
| status | back to summary |
|---|---|
| private HttpStatusCode status
| |
| view | back to summary |
|---|---|
| private Object view
| |
| ModelAndViewContainer | back to summary |
|---|---|
| public ModelAndViewContainer() | |
| addAllAttributes | back to summary |
|---|---|
| public ModelAndViewContainer addAllAttributes(Map<String, ?> attributes) Copy all attributes to the underlying model.
A shortcut for | |
| addAttribute | back to summary |
|---|---|
| public ModelAndViewContainer addAttribute(String name, Object value) Add the supplied attribute to the underlying model.
A shortcut for | |
| addAttribute | back to summary |
|---|---|
| public ModelAndViewContainer addAttribute(Object value) Add the supplied attribute to the underlying model.
A shortcut for | |
| containsAttribute | back to summary |
|---|---|
| public boolean containsAttribute(String name) Whether the underlying model contains the given attribute name.
A shortcut for | |
| getDefaultModel | back to summary |
|---|---|
| public ModelMap getDefaultModel() Return the "default" model created at instantiation. In general it is recommended to use
| |
| getModel | back to summary |
|---|---|
| public ModelMap getModel() Return the model to use -- either the "default" or the "redirect" model.
The default model is used if | |
| getSessionStatus | back to summary |
|---|---|
| public SessionStatus getSessionStatus() Return the | |
| getStatus | back to summary |
|---|---|
| public HttpStatusCode getStatus() Return the configured HTTP status, if any.
| |
| getView | back to summary |
|---|---|
| public Object getView() Return the View object, or
| |
| getViewName | back to summary |
|---|---|
| public String getViewName() Return the view name to be resolved by the DispatcherServlet via a
ViewResolver, or
| |
| isBindingDisabled | back to summary |
|---|---|
| public boolean isBindingDisabled(String name) Whether binding is disabled for the given model attribute.
| |
| isRequestHandled | back to summary |
|---|---|
| public boolean isRequestHandled() Whether the request has been handled fully within the handler. | |
| isViewReference | back to summary |
|---|---|
| public boolean isViewReference() Whether the view is a view reference specified via a name to be resolved by the DispatcherServlet via a ViewResolver. | |
| mergeAttributes | back to summary |
|---|---|
| public ModelAndViewContainer mergeAttributes(Map<String, ?> attributes) Copy attributes in the supplied | |
| removeAttributes | back to summary |
|---|---|
| public ModelAndViewContainer removeAttributes(Map<String, ?> attributes) Remove the given attributes from the model. | |
| setBinding | back to summary |
|---|---|
| public void setBinding(String attributeName, boolean enabled) Register whether data binding should occur for a corresponding model attribute,
corresponding to an Note While this flag will be taken into account by
| |
| setBindingDisabled | back to summary |
|---|---|
| public void setBindingDisabled(String attributeName) Programmatically register an attribute for which data binding should not occur,
not even for a subsequent
| |
| setIgnoreDefaultModelOnRedirect | back to summary |
|---|---|
| public void setIgnoreDefaultModelOnRedirect(boolean ignoreDefaultModelOnRedirect)
Deprecated since 6.0. as of 6.0 without a replacement; once removed, the default model will always be ignored on redirect By default, the content of the "default" model is used both during
rendering and redirect scenarios. Alternatively controller methods
can declare an argument of type Setting this flag to As of 6.0, this property is set to
| |
| setRedirectModel | back to summary |
|---|---|
| public void setRedirectModel(ModelMap redirectModel) Provide a separate model instance to use in a redirect scenario. The provided additional model however is not used unless
| |
| setRedirectModelScenario | back to summary |
|---|---|
| public void setRedirectModelScenario(boolean redirectModelScenario) Whether the controller has returned a redirect instruction, e.g. a "redirect:" prefixed view name, a RedirectView instance, etc. | |
| setRequestHandled | back to summary |
|---|---|
| public void setRequestHandled(boolean requestHandled) Whether the request has been handled fully within the handler, e.g.
The default value is | |
| setStatus | back to summary |
|---|---|
| public void setStatus(HttpStatusCode status) Provide an HTTP status that will be passed on to with the
| |
| setView | back to summary |
|---|---|
| public void setView(Object view) Set a View object to be used by the DispatcherServlet. Will override any pre-existing view name or View. | |
| setViewName | back to summary |
|---|---|
| public void setViewName(String viewName) Set a view name to be resolved by the DispatcherServlet via a ViewResolver. Will override any pre-existing view name or View. | |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Return diagnostic information.
| |
| useDefaultModel | back to summary |
|---|---|
| private boolean useDefaultModel() Whether to use the default model or the redirect model. | |