Re: query-param decode=”false”

Splash Forums PrettyFaces Users query-param decode="false" Re: query-param decode=”false”


There’s an important difference between using h:commmandLink, and using PrettyFaces navigation.

PrettyFaces navigation issues an HTTP-redirect, which means that an entirely separate request-response are issued to/from the browser. This means that all of your request scoped beans will no longer have values, and also means that the parameter value from the prior form POSTBACK (form submission) will no longer be available once that separate request is issued. This is called the “postback-redirect-pattern.”

Here’s a flow of how this works:

JSF Navigation:

Page A requested --> Page A rendered
Page A submitted via commandLink --> jsf navigation invoked --> Page B rendered

PrettyFaces Navigation:

Page A requested --> Page A rendered
Page A submitted via commandLink --> prettyfaces navigation invoked --> redirect to page B issued to browser
//at this point, any values submitted in the form need to have been handled, or they will be lost
Page B requested --> Page B rendered

The reason <managed-property> worked before is because there was no redirect after the POST, your action method invoked standard JSF navigation which in turn performed an internal rendering of the new view without issuing a browser-redirect to the URL of the new page.

You should not attempt to combine PrettyFaces mappings with the faces-config.xml file managed parameters or navigation, since they function in fundamentally different ways. PrettyFaces is intended to move managed-parameters into the URL so that they do not need to be configured in JSF, and can be bookmarked by web-users.

I’m not sure if this was a clear explanation, but let me know if that makes more sense.