English 中文(简体)
Can t get logout to work in Glassfish 3.1
原标题:

I have tried every way imaginable. Disabled SSO in Glassfish. Put session.invalidate() in a jsp page and redirected. Did a request.invalidate in a jsf backing bean. What should I do? Thanks.

EDIT

This works.

   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");
    }
}
问题回答

暂无回答




相关问题
Can I port Glassfish jdbcRealm to JBoss?

My application is running on Glassfish 3.1 using jdbcRealm is its authentication and authorization. I want to port this app to JBoss 6. Can I create a jdbcRealm inside JBoss 6 like in Glassfish3 that ...

question about GlassFish/Tomcat security realms

I have GlassFish set up to use "JDBCRealm". The configuration looks like this and it works fine: <JDBCRealm userTable="users" userNameCol="user_name" userCredCol="user_pass" userRoleTable="...

Can t get logout to work in Glassfish 3.1

I have tried every way imaginable. Disabled SSO in Glassfish. Put session.invalidate() in a jsp page and redirected. Did a request.invalidate in a jsf backing bean. What should I do? Thanks. ...

Java Application with Multiple JAAS Security Realms

I was wondering if it was possible to have a Java EE application with multiple JAAS security realms. I m currently developing an application in which some users need to be authenticated with data ...

Accessing secure restful web services using jersey client

I have created web services based on Jersey (auto generated via Netbeans). I have also created a user names “testClient” with password “secret” and created User group “Users” and used file Realm ...

热门标签