You can’t help but noticing the easy and beautiful friendly url in PHP pages, that it all depends on apache’s mod_rewrite and unfortunately Glassfish doesn’t have it, and if you want to apply it in JSF, or JSP you have to implement phase listeners, filters and, and …
Luckily created an API based on apache’s url rewrite.
Get the library, and here’s how you use it.

In the zip file you download you’ll get a .jsf file, add it to your project, also you’ll find an xml file urlrewrite.xml, copy it to your WEB-INF folder.
Copy the next into your web.xml and try to insert it as a first filter:



now you can write your URLs rules in urlrewrite.xml


In tag <rule> you define the url shape in the <from> tag, followed by a regular expression to define the type of your request get parameters, in the <to> tag, you define the definite jsf page with the parameters this page takes, $1 refers that id value will match the first acquired regular expression.
If you want to more than one parameter:


The author parameter will use the ([a-z]+) regexp, and article_id will respectively take ([0-9]+).

now your links can simply be as the next:

<h:outputLink value="news/#{}/#{BackingBean.articleId}">
        <h:outputText value="View Article" />

This tutorial was tested using JSF 1.2, Facelets 1.1.14 and UrlRewrite Filter 3.2.0