Re: FacesMessage not displayed when redirect using prettyfaces

Splash Forums PrettyFaces Users FacesMessage not displayed when redirect using prettyfaces Re: FacesMessage not displayed when redirect using prettyfaces

#20581

Unfortunately this is expected behavior. As the redirect results in a completely new request which is independent of the original request that generated the messages, these won’t be rendered on the page.

However there is a workaround for this issue. Lincoln wrote a PhaseListener that saves the messages in the session and restores them when the following request is received. To use this listener, just add the following lines to your faces-config.xml:

<lifecycle>
<phase-listener>com.ocpsoft.pretty.faces.event.MultiPageMessagesSupport</phase-listener>
</lifecycle>

I guess we should really mention this in the documentation. :-)