I’m new to PrettyFaces – but the tool is amazing. It solved a big problem we had.
However I’ve configured the phase listener in faces-config.xml – and I see when debugging that messages are saved correctly – however to get the messages saved I had to add “?faces-redirect=true&includeViewParams=true” to my return statement. Originally I just returned “pretty:base” which worked fined for the navigation part, but messages where not stored – when using the code below to fix message problem I don’t get corret navigation:
FacesContext.getCurrentInstance().addMessage( null, new FacesMessage( "Unknown store" ));
Output from browser:
Unable to find matching navigation case with from-view-id ‘/pages/unsecure/main.xhtml’ for action ‘/pages/unsecure/main.xhtml’ with outcome ‘UnknownStoreIdentifier?faces-redirect=true&includeViewParams=true’
Hmmm… Well, I can tell you that using JSF navigation is not entirely supported in PrettyFaces. Unfortunately once the JSF navigation system has been invoked, that means that all chance to intercept normal JSF navigation have passed already (thus once your faces-config.xml navigation cases are being evaluated, no extensions can intervene at this point since JSF is doing it’s default/native job.)
However, It’s a bit strange to me that the messages would be lost. And even stranger that <redirect/> is not sufficient, and even more strange is the fact that adding ?faces-redirect=true would have any effect.
I don’t think that your <from-outcome> should have anything other than UnknownStoreIdentifier – I don’t think the parameters should be included in your return statement, or in the config file since you are using the redirect tag.