|
[Deprecated API] | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | CURRENT API | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Object | +--com.interface21.web.servlet.ModelAndView
Holder for both Model and View in our MVC framework. Note that these are entirely distinct. This class merely holds both to make it possible for a controller to return both model and view in a single return value.
Class to represent a model and view returned by an handler used by a DispatcherServlet. The View can take the form of a reference to a View object, or a String view name, which will need to be resolved by a ViewResolver object. The model is a Map, allowing the use of multiple data objects.
| Constructor Summary | |
ModelAndView(java.lang.String viewName)
Convenient constructor when there is no model data to expose |
|
ModelAndView(java.lang.String viewName,
java.util.Map model)
Creates new ModelAndView given a viewName and a model. |
|
ModelAndView(java.lang.String viewName,
java.lang.String modelName,
java.lang.Object modelObject)
Convenient constructor to take a single model object. |
|
ModelAndView(View view)
Convenient constructor when there is no model data to expose |
|
ModelAndView(View view,
java.util.Map model)
Creates new ModelAndView given a View reference and a model. |
|
ModelAndView(View view,
java.lang.String modelName,
java.lang.Object modelObject)
Convenient constructor to take a single model object. |
|
| Method Summary | |
ModelAndView |
addObject(java.lang.String name,
java.lang.Object object)
Add an object to the model. |
java.util.Map |
getModel()
|
View |
getView()
|
java.lang.String |
getViewName()
|
boolean |
isReference()
|
java.lang.String |
toString()
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
public ModelAndView(View view)
view - view referencepublic ModelAndView(java.lang.String viewName)
viewName - view name, resolved by the controller servlet
public ModelAndView(View view,
java.util.Map model)
view - view to render this modelmodel - Map of model names (Strings) to
models (Objects). Model entries may not be null, but the
model may be null if there is no model data.
public ModelAndView(java.lang.String viewName,
java.util.Map model)
viewName - name of the View to render this model.
This will be resolved by the DispatcherServlet at runtime.model - Map of model names (Strings) to
models (Objects). Model entries may not be null, but the
model may be null if there is no model data.
public ModelAndView(View view,
java.lang.String modelName,
java.lang.Object modelObject)
view - view referencemodelName - modelName of the single entry in the modelObjectmodelObject - modelObject of the single entry in the modelObject
public ModelAndView(java.lang.String viewName,
java.lang.String modelName,
java.lang.Object modelObject)
viewName - name of the viewmodelName - modelName of the single entry in the modelObjectmodelObject - modelObject of the single entry in the modelObject| Method Detail |
public ModelAndView addObject(java.lang.String name,
java.lang.Object object)
name - name of the object to add to the modelobject - object to add to the model. May not be null.public boolean isReference()
public View getView()
public java.lang.String getViewName()
public java.util.Map getModel()
public java.lang.String toString()
toString in class java.lang.Object
|
[Deprecated API] | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | CURRENT API | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||