-
1. Re: FacesMessage propagation issue
lcoetzee Nov 13, 2006 11:47 AM (in response to lcoetzee)I have looked a bit at the FacesMessages.java. I think I understand why I loose my messages when I have @End(beforeRedirect=true). facesMessages is conversation scoped:
@Scope(ScopeType.CONVERSATION) @Name("facesMessages") @Intercept(NEVER) public class FacesMessages implements Serializable {
I assume it gets destroyed as part of the conversation end, with the resulting loss of the messages before it could be rendered.
Am I correct? Is there a way around it ?
Thanks
L -
2. Re: FacesMessage propagation issue
pmuir Nov 13, 2006 12:03 PM (in response to lcoetzee)Have you tried adding a FacesMessage the old way - directly to the facesContext?
-
3. Re: FacesMessage propagation issue
gavin.king Nov 13, 2006 12:20 PM (in response to lcoetzee)Exactly, the whole *reason* for propagating conversations across redirects is so that we can remember stuff like FacesMessages.
Pete, JSF most certainly does not propagate a FacesMessage across a redirect, so that won't work. -
4. Re: FacesMessage propagation issue
tazo Nov 13, 2006 4:33 PM (in response to lcoetzee)I noticed today what if i throw an exception annotated with @Redirect from page action then error message isn't displayed after redirect. Is it the same ussue?
How can workaround it? -
5. Re: FacesMessage propagation issue
gavin.king Nov 13, 2006 4:38 PM (in response to lcoetzee)hum. I will have to think that one through. It should work if you already have a long-running conversation active .... the question is whether we should promote a temporary conversation just to display the message (probably not).
But it might be worth adding an issue to JIRA, just to remind me to think this through properly sometime. -
6. Re: FacesMessage propagation issue
lcoetzee Nov 14, 2006 1:17 AM (in response to lcoetzee)I think Pete is refering to something as suggested in
http://forum.java.sun.com/thread.jspa?forumID=427&threadID=657727
This method saves a list of messages in the session which gets re-instated later on. I have used it before but had a few issues where the same error message gets displayed twice (probably something to do with the JSF phases).
Regards
L -
-
8. Re: FacesMessage propagation issue
gavin.king Nov 15, 2006 12:16 PM (in response to lcoetzee)Like I said, there is no good way to do this. That is the cost of ending the conversation before the redirect, and is why that is not the default behavior.
-
9. Re: FacesMessage propagation issue
asookazian Sep 19, 2007 11:35 AM (in response to lcoetzee)We just experienced this problem as well with Seam 1.2.1.GA and JBoss 4.0.5.GA.
I noticed in the hotel booking example, when the user ends the conversation by clicking the confirm button, it comes back to the main.xhtml with the success message and the Search Hotels inputText field pre-populated with the user entry from the previous conversation.
It seems to me that when the conversation ends with the confirm, the success message should display and the inputText field should be cleared. But this obviously depends on the functional requirements.
However, generally speaking, I would say the user would want to run a brand new search...
Is there any solution to this problem yet??? -