Closed GoogleCodeExporter closed 9 years ago
[deleted comment]
I tried out this patch but it does not help for the following case:
<rule>
<from>^/documents/(.*)$</from>
<to type="forward" encode="true">/MyServlet/document=$1</to>
</rule>
I've added the following lines to the code the get more infos:
if (isEncode()) {
System.out.println("target before encode: " + target);
target = hsResponse.encodeRedirectURL(target);
System.out.println("target after encode: " + target);
}
Using the Request URL:
http://localhost:8080/documents/document%20with%20spaces.pdf
returns the following output:
target before encode: /MyServlet/document=document with spaces.pdf
target after encode: /MyServlet/document=document with spaces.pdf
but not
target after encode: /MyServlet/document=document%20with%20spaces.pdf
or
target after encode: /MyServlet/document=document+with+spaces.pdf
kind regargds,
hasan
Original comment by hasan.ca...@gmail.com
on 10 Aug 2009 at 12:40
There seems to be a common misconception around the "encode" property in the
<to>
section of the rule. Unlike the regular understanding, the implementation of
this
property does not invoke java.net.URLEncoder#encode or any other known
subclasses. It
rather encodes the session-id into URL's as described here -
http://java.sun.com/products/servlet/2.2/javadoc/javax/servlet/http/HttpServletR
esponse.html#encodeURL(java.lang.String)
AFAIK, this is not doable without patching the Filter. There seems to be a valid
attempt made here -
http://code.google.com/p/urlrewritefilter/issues/detail?id=27
Paul, can you please throw some light on this?
Original comment by avl...@gmail.com
on 10 Aug 2009 at 3:47
Merging this into issue 27
(http://code.google.com/p/urlrewritefilter/issues/detail?id=27). A fix will
happen
against the same issue.
Original comment by avl...@gmail.com
on 7 Jan 2010 at 5:04
Original issue reported on code.google.com by
alon.car...@gmail.com
on 27 May 2009 at 12:13