request.getParameter Error when % contained in parameter value
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 (http://nagoya.apache.org/bugzilla/show_bug.cgi?id=3986) 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. java.io.CharConversionException: EOF at org.apache.tomcat.util.buf.UDecoder.convert(UDecoder.java:177) at org.apache.tomcat.util.buf.UDecoder.convert(UDecoder.java:144) at org.apache.tomcat.util.http.Parameters.processParameters(Parameters.java :514) at org.apache.tomcat.util.http.Parameters.processParameters(Parameters.java :541) at org.apache.tomcat.util.http.Parameters.handleQueryParameters(Parameters. java:318) at org.apache.coyote.tomcat4.CoyoteRequest.parseRequestParameters(CoyoteReq uest.java:1927) at org.apache.coyote.tomcat4.CoyoteRequest.getParameter(CoyoteRequest.java: 905) at org.apache.coyote.tomcat4.CoyoteRequestFacade.getParameter(CoyoteRequest Facade.java:174) at org.apache.jsp.findnaics_jsp._jspService(findnaics_jsp.java:55) at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:137) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.ja va:210) at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:295) at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Applica tionFilterChain.java:247) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilt erChain.java:193) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValv e.java:256) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.i nvokeNext(StandardPipeline.java:643) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:4 80) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValv e.java:191) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.i nvokeNext(StandardPipeline.java:643) at org.apache.catalina.authenticator.AuthenticatorBase.invoke(Authenticator Base.java:553) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.i nvokeNext(StandardPipeline.java:641) at org.apache.catalina.valves.CertificatesValve.invoke(CertificatesValve.ja va:246) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.i nvokeNext(StandardPipeline.java:641) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:4 80) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995) at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:241 7) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java :180) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.i nvokeNext(StandardPipeline.java:643) at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherVa lve.java:171) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.i nvokeNext(StandardPipeline.java:641) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java :172) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.i nvokeNext(StandardPipeline.java:641) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:4 80) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995) at
Re: request.getParameter Error when % contained in parameter value
Why don't you use: http://website/findnaics.jsp?code=%25 -Tim 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 (http://nagoya.apache.org/bugzilla/show_bug.cgi?id=3986) 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. java.io.CharConversionException: EOF at org.apache.tomcat.util.buf.UDecoder.convert(UDecoder.java:177) - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: request.getParameter Error when % contained in parameter value
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 [EMAIL PROTECTED] 801-302-8930 -Original Message- From: Tim Funk [mailto:[EMAIL PROTECTED] Sent: Monday, February 16, 2004 11:12 AM To: Tomcat Users List Subject: Re: request.getParameter Error when % contained in parameter value Why don't you use: http://website/findnaics.jsp?code=%25 -Tim 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 (http://nagoya.apache.org/bugzilla/show_bug.cgi?id=3986) 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. java.io.CharConversionException: EOF at org.apache.tomcat.util.buf.UDecoder.convert(UDecoder.java:177) - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: request.getParameter Error when % contained in parameter value
(Correction: not a crash - an error) --- Bill Faulk [EMAIL PROTECTED] 801-302-8930 -Original Message- From: Bill Faulk Sent: Monday, February 16, 2004 11:16 AM To: Tomcat Users List Subject: RE: request.getParameter Error when % contained in parameter value 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 [EMAIL PROTECTED] 801-302-8930 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: request.getParameter Error when % contained in parameter value
There looks to be a patch against this region of code in 4.1.30. (As compared to 4.1.29) Does the same thing happen there? -Tim Bill Faulk wrote: 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 [EMAIL PROTECTED] 801-302-8930 -Original Message- From: Tim Funk [mailto:[EMAIL PROTECTED] Sent: Monday, February 16, 2004 11:12 AM To: Tomcat Users List Subject: Re: request.getParameter Error when % contained in parameter value Why don't you use: http://website/findnaics.jsp?code=%25 -Tim 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 (http://nagoya.apache.org/bugzilla/show_bug.cgi?id=3986) 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. java.io.CharConversionException: EOF at org.apache.tomcat.util.buf.UDecoder.convert(UDecoder.java:177) - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: request.getParameter Error when % contained in parameter value
I'm installing 4.1.30 (alpha) on a server now to see. --- Bill Faulk [EMAIL PROTECTED] 801-302-8930 -Original Message- From: Tim Funk [mailto:[EMAIL PROTECTED] Sent: Monday, February 16, 2004 11:39 AM To: Tomcat Users List Subject: Re: request.getParameter Error when % contained in parameter value There looks to be a patch against this region of code in 4.1.30. (As compared to 4.1.29) Does the same thing happen there? -Tim Bill Faulk wrote: 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 [EMAIL PROTECTED] 801-302-8930 -Original Message- From: Tim Funk [mailto:[EMAIL PROTECTED] Sent: Monday, February 16, 2004 11:12 AM To: Tomcat Users List Subject: Re: request.getParameter Error when % contained in parameter value Why don't you use: http://website/findnaics.jsp?code=%25 -Tim 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 (http://nagoya.apache.org/bugzilla/show_bug.cgi?id=3986) 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. java.io.CharConversionException: EOF at org.apache.tomcat.util.buf.UDecoder.convert(UDecoder.java:177) - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]