我有以下可以正常工作的 spring mvc 代码片段:
控制器片段:
@RequestMapping(value="/submitForm", method=RequestMethod.POST)
public String formSubmission(Employee employee)
{
return "EmployeeWelcome";
}
在表格数据打印页面上:
<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>
以上成功打印了所有值,那么为什么需要以下内容?
ModelMap, Model, @ModelAttribute, ModelAndView