I have the following spring mvc code snippet that works fine:
Controller snippet:
@RequestMapping(value="/submitForm", method=RequestMethod.POST)
public String formSubmission(Employee employee)
{
return "EmployeeWelcome";
}
On form data printing page:
<html>
<h4>List of Request Parameters</h4>
<h4>first name - ${employee.firstName}</h4>
<h4>last name - ${employee.lastName}</h4>
<h4>user email - ${employee.email}</h4>
<h4>user salary - ${employee.salary}</h4>
</html>
The above prints all the values successfully, then why is the following required?
ModelMap, Model, @ModelAttribute, ModelAndView