String, Object
)Request
scope & then forwards the client to view layer.${requestScope.attrName}
org.springframework.web.servlet.ModelAndView
?Definition: It's a class representing a holder for model attributes + logical view name
Constructor:
ModelAndView(String forwardViewName, String modelAttrName, Object modelAttrVal)
What will be the valid return type of request handling method?
String
OR ModelAndView
: ModelAndView
Use: org.springframework.ui.Model
interface
Definition: It represents holder (Map) of model attributes
How to add model attributes?
public Model addAttribute(String modelAttrName, Object modelAttrVal)
Example: How to add multiple model attributes?
Who will supply empty Model map (as the dependency)?