tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 4966] - request.getParameter(String) SOMETIMES fail to parse the querystring
Date Tue, 04 Dec 2001 21:34:50 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=4966>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=4966

request.getParameter(String) SOMETIMES fail to parse the querystring





------- Additional Comments From andreas.bielk@codesense.com  2001-12-04 13:34 -------
Ok, I ran some tests today with both IBM1.3 (Linux) and Sun1.3.1 (Linux) with the following
code :

  protected void doGet(HttpServletRequest request, HttpServletResponse response)
    throws ServletException, IOException
  {
    // get requests and features
    String templateName = request.getParameter("t");

    if (templateName == null || templateName.equals(""))
    {
      // sout parameter and QueryString
      System.out.println((new Date())+" Parameter missing in request [" + request.getParameter("t")
+ "] in [" + request.getQueryString() + "]");

      // did we get ANY params?
      Enumeration enum = request.getParameterNames();
      while(enum.hasMoreElements())
      {
        String name = (String)enum.nextElement();
        String[] sarr = request.getParameterValues(name);
        for(int i1 = 0; i1 < sarr.length; i1++)
        {
          String s = sarr[i1];
          System.out.println(" --> " + name + " = " + s);
        }
      }
    }

    response.setContentType("text/plain");
    java.io.PrintWriter out = response.getWriter();
    out.println("TomcatTestServlet");
    out.close();
  }

The testcase was called 8 times/h for 8h and failed (IBM):
Tue Dec 04 11:04:33 GMT+01:00 2001 Parameter missing in request [null] in [t=billerud_day&f=pngm]
Tue Dec 04 12:14:34 GMT+01:00 2001 Parameter missing in request [null] in [t=billerud_day&f=pngm]
Tue Dec 04 17:12:36 CET 2001 Parameter missing in request [null] in [t=billerud_day&f=pngm]

e.g. neither the parameter "t" or "f" have been proparly parsed. The result with Sun1.3 was
the same (failed 4 times in 8h). Itīs really tricky to find the cause when itīs so hard to
reproduce (all bugs of the kind "sometime fails" are)! If I have time iīll try to run some
tests on a w2k tomorrow.

Any thoughts?

--
To unsubscribe, e-mail:   <mailto:tomcat-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:tomcat-dev-help@jakarta.apache.org>


Mime
View raw message