tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Bill Faulk" <>
Subject RE: request.getParameter Error when "%" contained in parameter value
Date Mon, 16 Feb 2004 18:15:32 GMT
The same error occurs for "%25". If I put a "%" anywhere in the
parameter I get a crash. "4%" would pass a parameter to query everything
starting with 4 in my example. 

Bill Faulk

-----Original Message-----
From: Tim Funk [] 
Sent: Monday, February 16, 2004 11:12 AM
To: Tomcat Users List
Subject: Re: request.getParameter Error when "%" contained in parameter

Why don't you use: http://website/findnaics.jsp?code=%25


Bill Faulk wrote:

> I am using Tomcat 4.1.29 on Windows 2000 Server with Java SDK 1.4.2.
> On the user query forms in my application "%" is a valid wildcard for 
> "all" as it is in the actual database query. I don't want to use blank

> for all because I don't want users to accidentally search for all 
> records; i.e. they have to actually enter % to search for all records 
> in a value. Blank parameters are ignored.
> Passing % as a parameter via GET or POST causes the error
> http://website/findnaics.jsp?code=4%
> I am using POST methods for the forms as in...
> <form method="POST" name="findform" action="findnaics.jsp">
> The request.getParameter line is actually generating the error if the 
> parameter contains a %.
> String code = request.getParameter("code");
> I've seen this error when searching in regards to forwarding pages
> ( but it was 
> considered "invalid" because forward expects an encoded url. However, 
> I am simply passing a parameter and submitting a form. Doing something

> like 'action = <%= response.encodeURL("findnaics.jsp") %>' doesn't do 
> anything for me. Using quotes/backslash, etc. doesn't make any 
> difference. These query parameters can be passed by both GET and POST 
> so encoding the URL isn't an option even if it did work.
> When "%" is passed as a parameter I get the following error for the 
> getParameter statement.
>         at
> org.apache.tomcat.util.buf.UDecoder.convert(

To unsubscribe, e-mail:
For additional commands, e-mail:

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message