2 Replies Latest reply on Jul 17, 2009 5:41 PM by oneworld95

    End session on error page

    oneworld95

      I've got a redirect on any exception in the Pages.xml file:


          <exception>
              <redirect view-id="/error.xhtml">
              </redirect>
          </exception>



      How do I invalidate the session when the user hits the error.xhtml page? Is there the equivalent of a server-side onLoad() method for a page in Seam/JSF? Thanks.

        • 1. Re: End session on error page
          asookazian
          "The proper way to invalidate the session would be to call #{org.jboss.seam.web.session.invalidate}."

          source: |http://lists.jboss.org/pipermail/seam-dev/2008-April/000195.html|

          So try this:

          <page view-id="/error.xhtml">
                   <action execute="#{org.jboss.seam.web.session.invalidate}"/>
          </page>
          • 2. Re: End session on error page
            oneworld95

            Thanks, John. Just what I needed :)


            A followup: At what point during the page lifecycle is the invalidate() method called? I'm displaying the exception details on the error.xhtml page; will the exception message still be there when the page loads?