Re: URLMapping pattern vs query parameters

Splash Forums PrettyFaces Users URLMapping pattern vs query parameters Re: URLMapping pattern vs query parameters


I think Lincoln is right. If you want to use a h:commandButton you should call an action that sets the target property in your bean correctly and then redirects to your page. PrettyFaces will then be able to create the correct link for the mapping. Something like this:

<h:commandButton value="EDIT" action="#{}" />

public class FindAccount {

private ManageAccount manageAccount;

public String show() {
manageAccount.setId( selectedItem.getId() );
return "pretty:manageAccount";


You could even do something similar without an action:

<h:commandButton value="EDIT" action="pretty:manageAccount">
<f:setPropertyActionListener target="#{}" value="#{}" />

But both methods will created a needless postback followed by a redirect to the correct URL. You won’t need the ugly postback if you use just a standard HTML link like this:

<pretty:link mappingId="manageAccount">
<f:param value="#{}"/>
Click me!

Hope this helps! :)