0% found this document useful (0 votes)
5 views

Data Transfer in Controllers

Uploaded by

devaanirudh323
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views

Data Transfer in Controllers

Uploaded by

devaanirudh323
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

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

You might also like