- Mastering Spring 5.0
- Ranga Rao Karanam
- 59字
- 2021-07-02 22:12:17
Putting an attribute in the session
Once we define an attribute in the @SessionAttributes annotation, it is automatically added to the session if the same attribute is added to the model.
In the preceding example, if we put an attribute with the name exampleSessionAttribute into the model, it would be automatically stored into the session conversation state:
model.put("exampleSessionAttribute", sessionValue);