看Tomcat admin源码,
public ActionForward execute(ActionMapping mapping,
ActionForm form,
HttpServletRequest request,
HttpServletResponse response)
throws IOException, ServletException { // Invalidate the current session and create a new one
HttpSession session = request.getSession();
session.invalidate();
session = request.getSession(true); // Forward control back to the main menu
return (mapping.findForward("Main Menu")); }
我想,其他的j2ee应用服务器也应该是一样的,就是
HttpSession session = request.getSession();
session.invalidate();
public ActionForward execute(ActionMapping mapping,
ActionForm form,
HttpServletRequest request,
HttpServletResponse response)
throws IOException, ServletException { // Invalidate the current session and create a new one
HttpSession session = request.getSession();
session.invalidate();
session = request.getSession(true); // Forward control back to the main menu
return (mapping.findForward("Main Menu")); }
我想,其他的j2ee应用服务器也应该是一样的,就是
HttpSession session = request.getSession();
session.invalidate();
LoginContext lc = new LoginContext("Test1Web", new HttpAuthCallbackHandler("lucifer", "12345"));
lc.login();
登录之后
request.getRemoteUser()
request.getUserPrincipal()都无法获取登录的用户信息
网上找了不少资料看也没什么帮助,哎....