Results 1 to 2 of 2

Thread: How to log out after sending a page?

  1. #1
    Join Date
    Dec 2012
    Posts
    1

    Default How to log out after sending a page?

    I have a program trigger an action in my JSF 2.0 application.

    In particular, the program tries to GET a JSF page, gets redirected to the Spring Security standard log in, does log in, and then GET the original JSF page again, passing some parameters in the URL. Unfortunately, said program does not log out. How can I log out anybody going to this particular page, but first send them said page?

    I tried
    Code:
    FacesContext fc = FacesContext.getCurrentInstance();
    ExternalContext extContext = fc.getExternalContext();
    HttpSession session (HttpSession) extContext.getSession(false);
    fc.renderResponse();
    fc.responseComplete();
    session.invalidate();
    but that sends the session expired page instead of the actual page to the program.

    Any ideas?

    Thanks,

    Robert

  2. #2
    Join Date
    Dec 2009
    Location
    India
    Posts
    108

    Default

    Why don't you create a simple filter which gets executed after your request and invalidates the request session. Seems a simpler approach.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •