package com.inetpsa.rvr.actions.general;
import org.apache.struts2.ServletActionContext;
import org.springframework.security.core.context.SecurityContextHolder;
public class LogoutAction extends ActionSupport {
private static final long serialVersionUID = 4294917247923577891L;
@Override
public String input() throws Exception {
// clear session
ServletActionContext.getRequest().getSession(false).invalidate();
// clear valorization
SecurityContextHolder.getContext().setAuthentication(null);
SecurityContextHolder.clearContext();
<span style="white-space:pre"> </span>// set menu false
setHasMenu(Boolean.FALSE);
return INPUT;
}
}
用户登出Logout or Timeout
最新推荐文章于 2022-08-06 16:55:51 发布