Logout from web app using tomcat Basic authentication

前端 未结 3 775
夕颜
夕颜 2021-02-06 02:32

I am using tomcat basic authentication for my web app:

I added following lines to web.xml in my web app:


    

        
3条回答
  •  遥遥无期
    2021-02-06 02:42

    public void logout() throws IOException {
        HttpServletRequest request = (HttpServletRequest) FacesContext.getCurrentInstance().getExternalContext().getRequest();
        try {
            request.logout();
        } catch (ServletException ex) {
            throw new IOException(ex);
        }
    }
    

提交回复
热议问题