上QQ阅读APP看书,第一时间看更新
Reading an attribute from the session
This value can be accessed in other controllers by first specifying the @SessionAttributes annotation at a type level:
@Controller
@SessionAttributes("exampleSessionAttribute")
public class SomeOtherController {
The value of the session attribute will be directly made available to all model objects. So, it can be accessed from the model:
Value sessionValue =(Value)model.get("exampleSessionAttribute");