phamthaithinh / urlrewritefilter

Automatically exported from code.google.com/p/urlrewritefilter
Other
0 stars 0 forks source link

request.getServletPath returns decoded path #183

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
The first line in UrlRewriter.getNewChain(..)
String servletPath = hsRequest.getServletPath();
obtains the servlet path decoded.
EG the url /katalog/jack+%26+jones
is returned as
/katalog/jack+&+jones

My rewrite rule (with decode-using="null")

<rule><from>^/katalog/(.*)$</from><to>/search/?c=y&amp;q=$1&amp;who=$1&amp;where
=</to></rule>
will then rewrite it to
/search/?c=y&amp;q=jack+&amp;+jones&amp;who=tofte+&amp;+jones&amp;where=
The &amp; is interpretted as a parameter deliminator and so jones is not
includes in the q parameter.
The rewritten url should be 
/search/?c=y&amp;q=jack+%26+jones&amp;who=tofte+%26+jones&amp;where=

Original issue reported on code.google.com by michaels...@gmail.com on 30 May 2007 at 10:38