看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();

解决方案 »

  1.   

    这种方法感觉上有些别扭,呵呵....我现在已经自己定制jaas认证了,不过还是不太清楚...
    LoginContext lc = new LoginContext("Test1Web", new HttpAuthCallbackHandler("lucifer", "12345"));
    lc.login();
    登录之后
    request.getRemoteUser()
    request.getUserPrincipal()都无法获取登录的用户信息
    网上找了不少资料看也没什么帮助,哎....
      

  2.   

    哪位用过jaas 自定义登录模块的经验吗?我只会在jaasrealm下用,但不太理想...