public class ModelAndView extends Object
Constructor and Description |
---|
ModelAndView(String view)
Creates a new model and view.
|
ModelAndView(String view,
Map<String,Object> model)
Creates a new model and view.
|
Modifier and Type | Method and Description |
---|---|
Map<String,Object> |
getModel()
View data (a.k.a as model).
|
String |
getView()
View name with file extension, like:
index.html . |
ModelAndView |
put(Map<String,Object> attributes)
Copy all the attributes into the model.
|
ModelAndView |
put(String name,
Object value)
Put a model attribute.
|
String |
toString() |
public ModelAndView(@Nonnull String view, @Nonnull Map<String,Object> model)
view
- View name must include file extension.model
- View model.public ModelAndView put(@Nonnull String name, Object value)
name
- Name.value
- Value.public ModelAndView put(@Nonnull Map<String,Object> attributes)
attributes
- Attributes.public Map<String,Object> getModel()
public String getView()
index.html
.index.html
.Copyright © 2020. All rights reserved.