Search code examples
jsf-2prettyfaces

Internally rewrite URLs in JSF with pretty-confg


When I use following code

<rewrite match="/foo/(\w+)/" substitute="/bar/$1/" />

From following resource prettyfaces It makes a redirect, I mean it changes URL in browser from '/foo' to '/bar'.

I want JSF to rewrite URL internally, I mean when user calls '/foo' or '/bar' it has to execute same resource.

Well I know I can add multiple URL pattern for same page bean, but actually URLs are complex (not just foo/bar) and I need to manipulate/rearrange path parameter to point to old URL from new URL. Is it possible?


Solution

  • Guys found the answer.

    I had to add attribute redirect="chain" to rewrite element and it worked. I hope it will help googlers..