0
votes

This is related to Changing Browser URL from backing bean

@balusc

How do I do the same thing in JSF 2? I have a search page with 6 different components (mostly PrimeFaces 3.0) for setting the search parameters. How can I get all the parameters to appear in the URL so that the user can share the results page using the URL?

I looked at PrettyFaces, and that seems to be capable of doing this in a better way, but I would rather make it work with just JSF2 if that is a simpler solution...

Thanks!

1

1 Answers

1
votes

You should either manually specify all the parameters via nested f:param tags like this:

<h:link outcome="nextPage">
    <f:param name="param1" value="val1" />
    <f:param name="param2" value="val2" />
</h:link>

or just specify includeViewParams parameter:

<h:link outcome="nextPage" includeViewParams="true">

The same goes for h:button