Data Transfer in Controllers
Getting values from index.jsp to Controller class
• Index.jsp
• Controller class
Will be using HttpServletRequest object to get the values from index.jsp to
controller class
Sending values from Controller class to other files
• Controller class
Using Model interface reference to pass the data
• Hello.jsp
Will be using ${-} to get the values from model
• Controller class
Using ModelAndView object to pass the data
Model :-
• Model is an interface that is used to store data that is rendered by a view
• It is a Map-Like object that stores key-value pairs where the key is the name of attribute
and the value is the attribute value
ModelAndView :-
• ModelAndView is a class that is used to return data from a controller to a view
• It can store any type of data i.e. Model data or Collection data etc which can be
transfered to the view