一 ModelAttribute注解
运行流程:
1. 执行@ModelAttribute注解修饰的方法:从数据库中取出对象,把对象放入map中,键为user。
2. SpringMVC从Map中取出User对象,并把表单的请求参数赋给该User对象的对应属性。
3. SpringMVC把上述对象传入目标方法的参数。
attention:在ModelAttribute修饰的方法中,放入到Map时的键需要和目标方法入参类型第一个字母小写的字符串一致。
二 视图和视图解析器
HANDLER
三 springMVC拦截器的配置
可以配置拦截器作用的路径,也可以配置拦截器不作用的路径。