Re: rewrite trailing slash and 3.3.0 snapshot

Splash Forums PrettyFaces Users rewrite trailing slash and 3.3.0 snapshot Re: rewrite trailing slash and 3.3.0 snapshot




I solved our problem by following ChKal’s advise to create a rewrite rule that won’t match on subsequent request. In our case I included the query parameter as part of the rewrite match rule, which will be replaced by another query parameter name on the substitute value. Note the following behavior though that the original request path info is still being used to test for subsequent rewrites


<rewrite match=”/catalog/subcatalog.jsp?(.)folder_id=([0-9]*)”

outbound=”false” substitute=”/subcatalog?subcat=$2″

redirect=”chain” />

Browser Request: /catalog/subcatalog.jsp?folder_id=12345

originalUrl evaluates to: /catalog/subcatalog.jsp?folder_id=12345

newUrl evaluates to: /subcatalog?folderid=12345

The request is forwarded to newUrl: /subcatalog?subcat=12345

Forwarded Request: /catalog/subcatalog?folderid=12345

originalUrl evaluates to: /catalog/subcatalog.jsp?subcat=12345

==> The original path is combined with the new query parameter. This is because PrettyContext has been initialized and will no longer be created for subsequent chain processing so the requestURL will always be the original path.