Re: h:link not work with url-mapping correctly, please help

Splash Forums PrettyFaces Users h:link not work with url-mapping correctly, please help Re: h:link not work with url-mapping correctly, please help

#20387

Hi @xuzhike,

This is correct behavior. <h:link> is a JSF2 component, and does not function the same way as <pretty:link> in the way that it accepts parameters.

You must follow the rules set by <h:link> when passing <f:param>.

<h:link> does not accept un-named parameters, since that’s not how URLs work in JSF2 by default. Using a prettyfaces mappingId in the outcome-"" attribute does not change this.

In order for <h:link> to function properly, all parameters must have both a name and a value:

<f:param name="cat" value="myValue">

PrettyFaces then uses that name to determine which parameter in the path the value belongs; in this case, which is cat:

<pattern>/login/#{ cat : homeView.text}/</pattern>
^