Re: [OT] JSP parameter frustration
Tony Field <[email protected]> Wed, 5 Jul 2006 14:16:43 -0400
| Newsgroups | gmane.text.xml.resin.user |
|---|---|
| Message-ID | <[email protected]> |
The servlet container is responsible for decoding the parameters for
you before it sets them into the HttpServletRequest object, so don't
double-decode it.
Tony
On 5-Jul-06, at 12:12 PM, Eric Carlson wrote:
> Resin 3.0.19. In a JSP I have this:
>
> String param = URLDecoder.decode(request.getParameter("p"));
>
> //param=URLDecoder.decode("%9E%9E%9E");
> byte[] paramArray = param.getBytes();
> for (int i =0; i<param.length(); i++) {
> System.out.print(paramArray[i];
> }
>
> If I visit the jsp with something like this (Firefox) :
> http://localhost:8080/foo/index.jsp?p=%9E%9E%9E
>
> I see 63 63 63 which is incorrect
> If I uncomment the //param line I see -98 -98 -98 which is correct.
> How am I supposed to extract the param properly please? Thanks.
>
>