I'm using the JBoss rewrite valve to rewrite some urls, and I ran into a problem with UTF-8 url encoded strings. The setup: i've a page to show a user's profile at "/member/profile.jsp". The urls are in format "/member/<utf-8 url encoded member name>", from which I parse the member name and pass it in the query string to the profile page.
Now, everything goes well, if the url looks 'friendly' (i.e., "/member/Endy" works just fine), but I've a problem with url such as this test case: "/member/%A4%25%26%2F%28%29%F3%F2".
There are two problems with this: First, the URL does not get forwarded, instead I get a 404 error stating "The requested URL /member/¤%&/()óò was not found on this server."
Second, the 404 error page config in web.xml does not work with this url. If I try with "/member/Endyfoobar123" it goes to my "/notfound.jsp" page just fine, but not with this.
Any ideas on this ?
Further investigation revealed that the actual problem is the %, & and / characters (naturally )
The solution was to encode the encoded URLs (as the rewrite valve only decodes it once )