Return-Path: Delivered-To: apmail-tomcat-dev-archive@www.apache.org Received: (qmail 9659 invoked from network); 22 Jan 2006 14:04:00 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 22 Jan 2006 14:04:00 -0000 Received: (qmail 19792 invoked by uid 500); 22 Jan 2006 14:03:58 -0000 Delivered-To: apmail-tomcat-dev-archive@tomcat.apache.org Received: (qmail 19746 invoked by uid 500); 22 Jan 2006 14:03:54 -0000 Mailing-List: contact dev-help@tomcat.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "Tomcat Developers List" Delivered-To: mailing list dev@tomcat.apache.org Received: (qmail 19734 invoked by uid 99); 22 Jan 2006 14:03:54 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 22 Jan 2006 06:03:54 -0800 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: local policy) Received: from [200.241.240.57] (HELO cascavel.amazon.com.br) (200.241.240.57) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 22 Jan 2006 06:03:52 -0800 Received: by cascavel.amazon.com.br (Amazon-Mail, from userid 104) id C4B862F4579; Sun, 22 Jan 2006 11:03:15 -0300 (BRT) Received: from [192.168.254.4] (unknown [201.29.130.191]) by cascavel.amazon.com.br (Amazon-Mail) with ESMTP id E5CC42F4545 for ; Sun, 22 Jan 2006 11:03:14 -0300 (BRT) Message-ID: <43D390A3.7010902@amazon.com.br> Date: Sun, 22 Jan 2006 11:03:15 -0300 From: Jair da Silva Ferreira Jr User-Agent: Mozilla Thunderbird 1.0.7 (Windows/20050923) X-Accept-Language: pt-br, pt MIME-Version: 1.0 To: Tomcat Developers List Subject: Re: problem with lost request parameters References: <43D11EAA.1090905@amazon.com.br> In-Reply-To: <43D11EAA.1090905@amazon.com.br> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Hi, I changed all my forms to method GET and the problem disappeared. So, I think there might be a problem with post form data processing in tomcat 5.5.12. I can't keep my forms in GET method because some of them submit the user password. So, any new ideas to solve the problem? Thanks, Jair Jr Jair da Silva Ferreira Jr escreveu: > Hi, > I posted this email in tomcat users list, but no one there could > really help me. So, I decided to post it here in the developers list > because I think there is a problem with tomcat code and maybe a > developer would help me better. I am sorry if I am incovenient in any > way. > > Here is my problem: > I have my web application hosted at brazilian Locaweb. It runs on a > Linux as40-32bits server with tomcat 5.5.15 and java 5. My application > runs with many (I don't know exactly how many) others in the same tomcat > server. My application uses postgresql 8 database, hibernate 2.1.7c, > servlet 2.4, jsp 2.0, jstl 1.1 and tiles without struts. > > My problem is that I can't get the request parameters submitted by > some of my users. My form uses the post method to submit its data. When > I call request.getParameter("validationScheme") in my servlet I get > null. request.getParametersNames() also returns an empty Enumeration. My > servlet then throws a ServletException because it can't find a mandatory > parameter. I have never experienced this problem in forms that use the > "get" method to submit its data. My form has few parameters, they are: > validationScheme (hidden), email and password. It is a simple login > form. Here is the relevant html code for my form: > >
" method="post" style="margin:0" > enctype="application/x-www-form-urlencoded" accept-charset="ISO-8859-1"> > > > > > > > > > >
align="right">e-mail size="17" maxlength="50">
align="right">senha class="combos" size="10"> > >
>
> > I have already tried the following: > - adding <%@ page contentType="text/html; charset=ISO-8859-1" %> > declaration in all my jsp pages; > - adding
accept-charset="ISO-8859-1"> attributes in all my html forms; > - adding in all my jsp and html pages; > - adding a filter that sets the request character encoding to > ISO-8859-1 (request.setCharacterEncoding("ISO-8859-1")). This filter is > executed for every jsp and servlet in my application; > - searched the web for "tomcat lost request parameter" and > "tomcat lose request parameter" using google and found nothing that > could help me; > > I asked the support people from Locaweb to execute tcpdump while my > user tried to submit the form. tcpdump results showed that the request > parameters are getting to tomcat correctly. So, I think that tomcat is > losing these parameters for some reason that I don't understand. > > I also noticed that these errors don't happen to all of my users, > but when it happens to a specific user, it can be easily reproduced by > that user. Unfortunately, I have never been able to reproduce the error > in my machines. > > Here is some user information logged by my error page when the > problem happens: > ======= > user 1 > ======= > Thu Jan 19 11:45:05 BRST 2006 > Request that failed: /v.servlet > Status code: 500 > Protocol: HTTP/1.0 > Remote Address: 201.9.198.113 > Remote Host: 201.9.198.113 > Remote Port: 0 > Local Address: > Local Name: www.dvdfilme.com.br > Local Port: 80 > Server Name: www.dvdfilme.com.br > Server Port: 80 > User Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0; > FunWebProducts) > Request Character Encoding: ISO-8859-1 > Request Content-type: application/x-www-form-urlencoded > Response Character Encoding: ISO-8859-1 > Response Content-type: text/html > Request Locale: pt_BR > Response Locale: pt_BR > Throwable: javax.servlet.ServletException: 'validationScheme' request > parameter not found > .... (exception stack trace) > request parameters: {} > > ======= > user 2 > ======= > Thu Jan 19 12:13:37 BRST 2006 > Request that failed: /v.servlet > Status code: 500 > Protocol: HTTP/1.1 > Remote Address: 201.29.118.23 > Remote Host: 201.29.118.23 > Remote Port: 0 > Local Address: > Local Name: www.dvdfilme.com.br > Local Port: 80 > Server Name: www.dvdfilme.com.br > Server Port: 80 > User Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0) > Request Character Encoding: ISO-8859-1 > Request Content-type: application/x-www-form-urlencoded > Response Character Encoding: ISO-8859-1 > Response Content-type: text/html > Request Locale: pt_BR > Response Locale: pt_BR > Throwable: javax.servlet.ServletException: 'validationScheme' request > parameter not found > .... (exception stack trace) > request parameters: {} > > I also looked at tomcat 5.5.15 source code, class > org.apache.coyote.tomcat4.CoyoteRequest, method parseRequestParameters() > and noticed that expections (Throwable) are "swallowed" in request > parameter processing. So, I think that if any problem happens during > this process, the code will silently ignore the request parameter. I > also think that this is what is happening in my case. Here is the > relevant part of the code: > > /** > * Parse request parameters. > */ > protected void parseRequestParameters() { > .... > int len = getContentLength(); > > if (len > 0) { > try { > byte[] formData = null; > if (len < CACHED_POST_LEN) { > if (postData == null) > postData = new byte[CACHED_POST_LEN]; > formData = postData; > } else { > formData = new byte[len]; > } > int actualLen = readPostBody(formData, len); > if (actualLen == len) { > parameters.processParameters(formData, 0, len); > } > } catch (Throwable t) { > ; // Ignore > } > } > } > > Please, is there anything else I can do to fix this problem? Do you > have any ideas to help me? Any help would be really appreciated. > Thank you very much for your help. > > Thanks, > Jair Jr > > --------------------------------------------------------------------- > To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org > For additional commands, e-mail: dev-help@tomcat.apache.org > > > --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org For additional commands, e-mail: dev-help@tomcat.apache.org