Re: Rewrite every *.jsf

Splash Forums PrettyFaces Users Rewrite every *.jsf Re: Rewrite every *.jsf



I’m trying to do something similar – where every request that comes through tries to forward to *.jsf (if there isn’t a previous mapping that forwards it to a different resource). With the UrlRewriteFilter, I’m almost able to accomplish what I want using the following:



<to type="redirect" last="true">mainMenu</to>


























<!-- Struts -->

<rule match-type="regex">


<to last="true">$1/$2.jsf$3</to>


<outbound-rule match-type="regex">


<to last="false">$1$2</to>


However, I’ve run into an issue where UrlRewriteFilter intercepts a post on my File Upload form and doesn’t submit it to my managed bean properly. So I’ve turned to Pretty Faces in hopes of getting something similar setup.

Here’s what I have so far:

<rewrite match="^/login$" substitute="/login.jsp" redirect="chain"/>

<rewrite match="/$" substitute="/mainMenu" redirect="302"/>

<rewrite match="^([^?]*)/([^?/.]+)(?.*)?$" substitute="$1/$2.jsf$3" redirect="chain"/>

Unfortunately, this results in the following, which I’m guessing is caused by a continuous redirect.

2011-01-28 07:58:49.761:WARN::Error for /mainMenu


at java.util.HashMap.removeEntryForKey(

at java.util.HashMap.remove(

at org.mortbay.util.AttributesMap.removeAttribute(

at org.mortbay.jetty.servlet.Dispatcher$ForwardAttributes.setAttribute(

at org.mortbay.jetty.servlet.Dispatcher$ForwardAttributes.removeAttribute(

Does Pretty Faces have the ability to say “last” on a rewrite rule and forward from there w/o processing again?