It seems like the best way to do this is to create a PhaseListener, "that moves 
messages from the
FacesContext to the user's session and back in the appropriate phases of the 
JSF lifecycle. "

Please see Variant 2:

http://jsffaq.com/Wiki.jsp?ptitle=How+to+show+Faces+Message+on+the+Next+Page%3F&page=HowToShowFacesMessageOnTheNextPage

I think this approach can be greatly simplified by not getting all the messages 
from the
FacesContext, then cycling through the messages and removing the client 
specific messages, then
putting the remaining messages into the session,  Rather, in most cases you are 
going to know the
message or messages you want to appear on the next page; it will be much 
simpler to place these
messages directly into a collection which is held in the session, and then all 
the PhaseListener
has to do is check the session object and get the messages at the beginning of 
the next cycle and
then put the messages into the FacesContext.

It seems like a cool approach.  I shall give it a try.

Thx to:  <a href="mailto:[EMAIL PROTECTED]">Jesse Wilson</a>

BTW:  Shouldn't this behavior be intrinsic to JSF?

Mike 


--- Mike Duffy <[EMAIL PROTECTED]> wrote:

> It seems that the <h:messages> tag only works within a request.  If something 
> goes wrong on the
> current page, the messages display fine. 
> 
> What I would like to be able to do is display a message on the next page (in 
> a new request
> scope)
> once the current page has processed.  I can't seem to get this to work.
> 
> Is there a session scope for the <h:messages>?
> 
> Am I missing something basic?
> 
> Thx.
> 
> Mike
> 
> __________________________________________________
> Do You Yahoo!?
> Tired of spam?  Yahoo! Mail has the best spam protection around 
> http://mail.yahoo.com 
> 


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

Reply via email to