used spring mvc session

Example: After the user logs in successfully, the user object is placed in the session
The first step, after the user logs in successfully to the user object in the first place Model
The second step, to add annotations SessionAttributes on the controller, and then put the objects into the model
Session in
The third step, in other requests, to see if I can place the data acquired in the session
First, using the model object is placed into the model, based on the annotation @SessionAttributes added, then the method checks been performed to model placed
Whether the data is also to be placed in the session. If necessary, it places a copy. Then you can get the data directly in the session.

Guess you like

Origin www.cnblogs.com/duguangming/p/10944241.html