我有一个像这样的课程:
@Controller(value = "services")
@RequestMapping("/")
@SessionAttributes({"SESSIONID"})
public class Services {
@RequestMapping("/user/loginStatic")
@ModelAttribute("SESSIONID")
public LoginResponseBean loginStatic(String username){
LoginResponseBean result = otherClass.login(username);
retrun result;
}
}
我的问题:这段代码导致在会话中存储“结果”对象,但我想在会话中存储“result.getSessionId()”。
我不能将“模型模型”添加到“loginStatic”方法的输入参数,因为它会改变方法的签名,我现在不能这样做。而且我无法明确获取http会话并在其中设置属性(因为其他一些副作用)。我怎么能那样做?谢谢..