Re: how to use pretty:

Splash Forums PrettyFaces Users how to use pretty: Re: how to use pretty:


The prefix pretty: is always used together with a mapping id. So if you want to use it, you will have to define an URL mapping (in pretty-config.xml or with annotations).

See the following mapping. I hope this description fits your example:

<url-mapping id="dressesId">
<pattern value="/page/dresses.jsf" />

So when your action returns pretty:dressesId, the user will be redirected to /page/dresses.jsf. This URL will then render the view that is named /page/1.jsf in your application directory (strictly speaking it is /page/1.xhtml).

If your pattern contains path parameters, PrettyFaces will replace the pattern in the URL by the actual value of the referenced bean property. This means that the bean property must be set to the correct value before returning pretty:dressesId.

If you want to render links directly in your JSF page, you can use the <pretty:link> component. This way you can directly set the values to be set in the URL pattern. See the documentation for details: