@ModelAttribute parametric methods and target methods can be modified
- Modification methods:
1) modified method will be called before invoking the target method
2) using HashMap, Model in the modified approach, ModelMap into key-value pairs, springmvc will be among the data stored in the data model; source code representation. in the process of entering @ModelAttribute modified in the examples will first container mav, after the data placed into the container
- Modification of the target method parameter
1) to determine a first @ModelAttribute springmvc the key to find corresponding to the key value, start with how to determine; if @ModelAttribute specified key, as shown on the "person", that person is the key; if not specified, the formpublic String update(Person person)
, the name of the class parameters will bePerson
a first variant of a lowercase letter key, isperson
2) to determine the key, @ ModelAttribute find key values according to the go mavContainer, there is imparted to it. target method parameter, will not determine whether the Controller with @SessionAttribute modification, if the modification is to find whether the value into the session, did not find the will throw an exception if the Controller @SessionAttribute not been modified, it is a reflection a new parameter objects, in turn shaped among participants is given request forwarded