The ModelAndView interface

The ModelAndView interface plays a vital role for response generation. The instance of the ModelAndView interface facilitates binding of model data to its logical name and logical view name. The object that holds the data to be used in view is generally referred to as model data. The following snippet makes it clear how binding happens:

new ModelAndView(logical_name_of_view,logical_name_of_model_data, 
actual_value_of_model_data);

Instead, we can even use the following snippet code:

ModelAndView mv=new ModelAndView(); 
mv.setViewName("name_of_the_view"); 
mv.setAttribute(object_to_add); 
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.191.181.231