Hi, I’m new on prettyfaces. Currently I have developed a website, http://www.adsafari.us, using Primefaces + Prettyfaces.
The prettyfaces was added lately on simple URLs, however I get something weird regarding faces message. My faces message (using primefaces p:message) was not displayed when I redirect page from action method. When i use something like this (returns JSF 2 implicit navigation), the message was displayed correctly:
but when I change the return value into “pretty:member_home”, navigation was redirected to proper page, but no message displayed. I guess this is something related with faces-redirect, but i don’t know how to display the message.
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:
No, the messages are saved just before the redirect is sent and then restored when the new request arrives. After that they will be immediately removed from the session. So they won’t increase the session size.