| java.lang.Object org.springframework.web.portlet.ModelAndView
Constructor Summary | |
public | ModelAndView() Default constructor for bean-style usage: populating bean
properties instead of passing in constructor arguments. | public | ModelAndView(String viewName) Convenient constructor when there is no model data to expose. | public | ModelAndView(Object view) Convenient constructor when there is no model data to expose. | public | ModelAndView(String viewName, Map model) Create a new ModelAndView given a view name and a model.
Parameters: viewName - name of the View to render, to be resolvedby the DispatcherPortlet's ViewResolver Parameters: model - Map of model names (Strings) to model objects(Objects). | public | ModelAndView(Object view, Map model) Create a new ModelAndView given a View object and a model.
Parameters: view - View object to render (usually a Servlet MVC View object) Parameters: model - Map of model names (Strings) to model objects(Objects). | public | ModelAndView(String viewName, String modelName, Object modelObject) Convenient constructor to take a single model object. | public | ModelAndView(Object view, String modelName, Object modelObject) Convenient constructor to take a single model object. |
Method Summary | |
public ModelAndView | addAllObjects(Map modelMap) Add all entries contained in the provided map to the model. | public ModelAndView | addObject(Object modelObject) Add an object to the model using parameter name generation. | public ModelAndView | addObject(String modelName, Object modelObject) Add an object to the model. | public void | clear() Clear the state of this ModelAndView object. | public Map | getModel() Return the model map. | protected Map | getModelInternal() Return the model map. | public ModelMap | getModelMap() Return the underlying ModelMap instance (never null ). | public Object | getView() Return the View object, or null if we are using a view name
to be resolved by the DispatcherPortlet via a ViewResolver. | public String | getViewName() Return the view name to be resolved by the DispatcherPortlet
via a ViewResolver, or null if we are using a view object. | public boolean | hasView() Indicate whether or not this ModelAndView has a view, either
as a view name or as a direct view instance. | public boolean | isEmpty() Return whether this ModelAndView object is empty
i.e. | public boolean | isReference() Return whether we use a view reference, i.e. | public void | setView(Object view) Set a View object for this ModelAndView. | public void | setViewName(String viewName) Set a view name for this ModelAndView, to be resolved by the
DispatcherPortlet via a ViewResolver. | public String | toString() Return diagnostic information about this model and view. | public boolean | wasCleared() Return whether this ModelAndView object is empty as a result of a call to
ModelAndView.clear i.e. |
ModelAndView | public ModelAndView(String viewName)(Code) | | Convenient constructor when there is no model data to expose.
Can also be used in conjunction with addObject .
Parameters: viewName - name of the View to render, to be resolvedby the DispatcherPortlet's ViewResolver See Also: ModelAndView.addObject |
ModelAndView | public ModelAndView(Object view)(Code) | | Convenient constructor when there is no model data to expose.
Can also be used in conjunction with addObject .
Parameters: view - View object to render (usually a Servlet MVC View object) See Also: ModelAndView.addObject |
ModelAndView | public ModelAndView(String viewName, Map model)(Code) | | Create a new ModelAndView given a view name and a model.
Parameters: viewName - name of the View to render, to be resolvedby the DispatcherPortlet's ViewResolver Parameters: model - Map of model names (Strings) to model objects(Objects). Model entries may not be null , but themodel Map may be null if there is no model data. |
ModelAndView | public ModelAndView(Object view, Map model)(Code) | | Create a new ModelAndView given a View object and a model.
Parameters: view - View object to render (usually a Servlet MVC View object) Parameters: model - Map of model names (Strings) to model objects(Objects). Model entries may not be null , but themodel Map may be null if there is no model data. |
ModelAndView | public ModelAndView(String viewName, String modelName, Object modelObject)(Code) | | Convenient constructor to take a single model object.
Parameters: viewName - name of the View to render, to be resolvedby the DispatcherPortlet's ViewResolver Parameters: modelName - name of the single entry in the model Parameters: modelObject - the single model object |
ModelAndView | public ModelAndView(Object view, String modelName, Object modelObject)(Code) | | Convenient constructor to take a single model object.
Parameters: view - View object to render (usually a Servlet MVC View object) Parameters: modelName - name of the single entry in the model Parameters: modelObject - the single model object |
addAllObjects | public ModelAndView addAllObjects(Map modelMap)(Code) | | Add all entries contained in the provided map to the model.
Parameters: modelMap - a map of modelName -> modelObject pairs this ModelAndView, convenient to allow usages likereturn modelAndView.addAllObjects(myModelMap); |
addObject | public ModelAndView addObject(String modelName, Object modelObject)(Code) | | Add an object to the model.
Parameters: modelName - name of the object to add to the model Parameters: modelObject - object to add to the model (never null ) this ModelAndView, convenient to allow usages likereturn modelAndView.addObject("foo", bar); |
getModel | public Map getModel()(Code) | | Return the model map. Never returns null .
To be called by application code for modifying the model.
|
getModelInternal | protected Map getModelInternal()(Code) | | Return the model map. May return null.
Called by DispatcherPortlet for evaluation of the model.
|
getModelMap | public ModelMap getModelMap()(Code) | | Return the underlying ModelMap instance (never null ).
|
getView | public Object getView()(Code) | | Return the View object, or null if we are using a view name
to be resolved by the DispatcherPortlet via a ViewResolver.
|
getViewName | public String getViewName()(Code) | | Return the view name to be resolved by the DispatcherPortlet
via a ViewResolver, or null if we are using a view object.
|
hasView | public boolean hasView()(Code) | | Indicate whether or not this ModelAndView has a view, either
as a view name or as a direct view instance.
|
isEmpty | public boolean isEmpty()(Code) | | Return whether this ModelAndView object is empty
i.e. whether it does not hold any view and does not contain a model.
|
isReference | public boolean isReference()(Code) | | Return whether we use a view reference, i.e. true
if the view has been specified via a name to be resolved by the
DispatcherPortlet via a ViewResolver.
|
setView | public void setView(Object view)(Code) | | Set a View object for this ModelAndView. Will override any
pre-existing view name or View.
The given View object will usually be a Servlet MVC View object.
This is nevertheless typed as Object to avoid a Servlet API dependency
in the Portlet ModelAndView class.
|
setViewName | public void setViewName(String viewName)(Code) | | Set a view name for this ModelAndView, to be resolved by the
DispatcherPortlet via a ViewResolver. Will override any
pre-existing view name or View.
|
toString | public String toString()(Code) | | Return diagnostic information about this model and view.
|
wasCleared | public boolean wasCleared()(Code) | | Return whether this ModelAndView object is empty as a result of a call to
ModelAndView.clear i.e. whether it does not hold any view and does not contain a model.
Returns false if any additional state was added to the instance
after the call to
ModelAndView.clear .
See Also: ModelAndView.clear() |
|
|