java.lang.Object
io.jooby.ModelAndView
Used by template engines to renderer views.
- Since:
- 2.0.0
- Author:
- edgar
-
Constructor Summary
ConstructorDescriptionModelAndView
(String view) Creates a new model and view.ModelAndView
(String view, Map<String, Object> model) Creates a new model and view. -
Method Summary
Modifier and TypeMethodDescriptionReturns the locale used when rendering the view.getModel()
View data (a.k.a as model).getView()
View name with file extension, like:index.html
.Put a model attribute.Copy all the attributes into the model.Sets the locale used when rendering the view, if the template engine supports setting it.toString()
-
Constructor Details
-
ModelAndView
Creates a new model and view.- Parameters:
view
- View name must include file extension.model
- View model.
-
ModelAndView
Creates a new model and view.- Parameters:
view
- View name must include file extension.
-
-
Method Details
-
put
Put a model attribute.- Parameters:
name
- Name.value
- Value.- Returns:
- This model and view.
-
put
Copy all the attributes into the model.- Parameters:
attributes
- Attributes.- Returns:
- This model and view.
-
setLocale
Sets the locale used when rendering the view, if the template engine supports setting it. Specifyingnull
triggers a fallback to a locale determined by the current request.- Parameters:
locale
- The locale used when rendering the view.- Returns:
- This instance.
-
getModel
View data (a.k.a as model).- Returns:
- View data (a.k.a as model).
-
getView
View name with file extension, like:index.html
.- Returns:
- View name with file extension, like:
index.html
.
-
getLocale
Returns the locale used when rendering the view. Defaults tonull
, which triggers a fallback to a locale determined by the current request.- Returns:
- The locale used when rendering the view.
-
toString
-