3 Replies Latest reply on Jan 4, 2008 6:53 PM by jacob.orshalick

    Displaying message after logout

    seamdev


      I need to display a custom message after logout action. Can you recommend a good way to do it? Application redirects to login page after logout, so this message needs to be displayed on login page.

        • 1. Re: Displaying message after logout
          pmuir

          Observe the org.jboss.seam.security.loggedOut event

          • 2. Re: Displaying message after logout
            seamdev


            I need little more direction here. I have got an observer for logout event setup. What should this observer method do? What should be the scope of bean containing observer method? Messages added to current instance of javax.faces.FacesContext don't show up on next page. The observer method is getting executed (can see log statements from this method).

            Also, if I want to display additional message after logout based on an other event my app raises while the user is logged in, will this approach work?

            • 3. Re: Displaying message after logout

               

              "seamdev" wrote:
              Messages added to current instance of javax.faces.FacesContext don't show up on next page.


              You should add messages to the Seam FacesMessages component as it is scoped to the conversation which is carried across redirects...

              Then again, I believe you are going to have issues here regardless because from my recollection the session is expired by the identity.logout action. The FacesMessages component is scoped to the conversation and the conversation is destroyed along with the session. Thus, any messages you have added will be gone when a new session is created and a temporary conversation is started.

              Try out the FacesMessages component though, and let me know what happens...

              I wrote a blog posting a little while back on differentiating between a fresh login, session expired, and logout:

              http://solutionsfit.com/blog/2007/11/16/session-expired-messages-using-seam-security/

              It doesn't address your exact scenario but will provide a little insight into the messaging issues with security.