Search code examples
jsfpath-parameter

Links with path parameters in JSF


In social networks like facebook you have links like https://www.<socialNetwork>.com/<userName>/about for example.

How can this be done with JSF? I mean, the way I am doing now is with parameters (which is quite ugly):

https://www.<socialNetwork>.com?userName=<userName>&page=about

I want the page to be bookmarkable, so I need the parameters in the url.


Solution

  • You need to use some kind of URL Rewriter which converts your application URLs with parameters into something nicer. I can recommend either Pretty Faces or Rewrite, you can see comparison of those two here.