我有Spring REST webserivce现在从移动客户端Web服务被调用.首先,根据发送的值userid和password调用login方法登录成功或失败.
@RequestMapping(value = "/login", method = RequestMethod.POST, headers="Accept=application/json")
public @ResponseBody List<LogInStatus> getLogIn(@RequestBody LogIn person , HttpServletRequest request) {
// Call service here
List<LogInStatus> lList = logInService.getUser(person);
//service method and then in DAO database method is there
return lList;
}
Run Code Online (Sandbox Code Playgroud)
现在,对于许多其他调用,我需要登录基于用户的值,因此需要保持会话并需要获取当前用户.在注销调用时,需要销毁会话.如何做到这一点并实现,请帮助提出想法.