According to this: http://java.net/jira/browse/JAVASERVERFACES-2136 flash-"scoped" messages should survive a redirect to a page on a different path.. I wanted to use something like this in my application so i downloaded javax.faces-2.1.14-20121003.074348-10 snapshot from here https://maven.java.net/content/repositories/snapshots/org/glassfish/javax.faces/2.1.14-SNAPSHOT/ to test.
My situation is this: I have a page (call it test.xhtml) in the root directory that in the view-scoped backing bean during the call of the constructor does a check and conditionally sets a message using Omnifaces Message.addFlashGlobalInfo
and redirects to index.xthml also in the root directory using Omnifaces Faces.Redirect()
(thanks BalusC!). In index.xhtml i have a Primefaces
<p:messages id="msg" showDetail="false" autoUpdate="true" />
I use the same "configuration" described above in other pages as well and it works fine when the redirect is done to the same page called the bean method.
So shouldn't the message survive the different path redirect or did i misunderstood something about this issue?? maybe there is something else wrong here??
Thanks in advance! (i'm looking forward hearing BalusC opinion on this btw :) )
<f:event type="preRenderView" >
to call an init method that does sets message and redirects but again no message appears!! so i don't think PostConstruct will work either.. – VergepreRenderView
doesn't work then@PostConstruct
will very likely not work as well. – Kkt