2 Replies Latest reply on Jul 6, 2007 2:27 PM by Monkey Den

    FacesMessages living beyond notLoggedIn Event

    Monkey Den Master

      I have the following code which adds a faces message and raises a "org.jboss.seam.notLoggedIn" event when the user attempts to do something which requires login. For some reason the message doesn't live beyond the event. Can anyone shed some light on this behavior?

      facesMessages.add(FacesMessage.SEVERITY_INFO, mustBeLoggedInMessage);
      result = "login";

        • 1. Re: FacesMessages living beyond notLoggedIn Event
          Shane Bryzak Master

          By default, Seam does not intercept the notLoggedIn event. However, faces messages are conversation scoped, and if you've hooked up redirect.captureCurrentView to this event in your components.xml (as I'm guessing) then this might explain it. I suggest putting a breakpoint in org.jboss.seam.faces.Redirect.captureCurrentView() and watch what happens to the conversation context here.

          • 2. Re: FacesMessages living beyond notLoggedIn Event
            Monkey Den Master

            Thanks Shane. This is exactly what I'm doing. At the start of that method there is a FacesContext created and messages is already empty. I suspect that something is happening before we get there. I hoped that by joining the conversation, messages would be available:

            conversationBegun = Conversation.instance().begin(true, false);

            No such luck. Am I misinterpreting what's going on here?