spring mvc @ ModelAttribute and @SessionAttributes implementation process

DJANGO spring mvc than the python's much harder, @ MODELATTRIBUTE and SESSIONATTRIBUTE So now this is just get to know.

 When using @ModelAttribute annotation, the value will take @ModelAttribute value, if the value @ModelAttribute value of the empty string (i.e., not configured @ModelAttribute value attribute), the current will @ModelAttribute Bean parameters or direct modification method @ModelAttribute modified with the first letter lowercase Bean Bean name as attrName.

        Next will determine if the request (Map) included attrName bond, then take the key to the value assigned to attrName Bean, if not included, determines whether the current Handler @SessionAttribute. The use of the value will be determined @SessionAttribute or whether to include the names attrName, if so, the value will @SessionAttribute attrName named as attrName values, if the values ​​or names @SessionAttribute contained no corresponding value, an exception is thrown. If the request (Map) and @SessionAttribute not included arrtName the use of the newly created Bean reflection of a attrName

Guess you like

Origin www.cnblogs.com/linwenbin/p/10962088.html