Reply To: Escaping the hash symbol in a URL

Splash Forums PrettyFaces Users Escaping the hash symbol in a URL Reply To: Escaping the hash symbol in a URL

#26524

I think he wants to have PrettyFaces generate an outbound link that adds the anchor. Afaik, the best way to do this is to issue a redirect yourself:

Assuming your mapping is this:

<url-mapping id=”/vanity-test”>
<pattern>/vanity-test</pattern>
<view-id>/folder1/folder2/vanity-test.jsf</view-id>
</url-mapping>

facesContext.getCurrentInstance().getExternalContext().sendRedirect("/folder1/folder2/vanity-test.jsf#tab-2")

And PrettyFaces should issue a new URL:

/vanity-test#tab-2

~lincoln