无法注销在Glassfish 3.1中工作

时间:2011-03-03 15:31:05

标签: jsf-2 glassfish-3 jdbcrealm

我尝试过各种可想象的方式。在Glassfish中禁用SSO。将session.invalidate()放在jsp页面中并重定向。在jsf支持bean中有一个request.invalidate。我该怎么办?感谢。

修改

这很有效。

   private String email;

public ViewLines() {


}

@PostConstruct
public void onLoad() {

    Principal principal = FacesContext.getCurrentInstance().getExternalContext().getUserPrincipal();
    email = principal.getName();

    if (email != null) {
        User user = userService.findUserbyEmail(email);

        for (Acl acl : user.getAclList()) {

            if (acl.getAccess().equals("allow")) {
                digPackageLines(acl.getTreeId());
            }
        }
    } else {
        FacesUtils.addFatalMessage("Couldn't find user information from login!");
    }
}  


 @WebServlet(value = "/j_security_logout")
public class LogoutServlet extends HttpServlet {

    @Override
    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {

        request.getSession().invalidate();
        response.sendRedirect("index.jsf");
    }
}

0 个答案:

没有答案