You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Byron Frank <br...@nurelm.com> on 2002/02/06 21:34:42 UTC

Problem with FORM POST data on Windows

Hi:

I'm having a problem reading forms data using POST through Apache.

Setup:
  Apache 1.3.23 / Tomcat 3.2.2 / mod_jk / Win 2000
    mod_jk setup to use ajp13

Summary:
  A form with method="POST" is action'ed to a JSP.
  The forms data should be in the request object.
  When I hit the jsp directly through tomcat (port 8080),
    the data are present.
  When I hit the jsp through apache, the request object
    does not contain the forms data.
  (All other Apache / Tomcat interactions seems to work fine.)

  This situation happens under Windows 2000, *not* under
    an identical setup under Linux (RH 7.1)

Details:
  -- File form.jsp ----------
  <html>
  <head><title>Check Page</title></head>

  <body>
  All right, enter your name:

  <form action="process_form.jsp" method="post">
    <input type="text" name="name">
    <input type="submit" name="Click me">
    <input type="hidden" name="command" value="punt" >
  </form>

  </body>
  </html>
  ---------------------------

  -- File process_form.jsp --
  <html>
  <head><title>Check Data</title></head>

  <body>
  Results:
  <%
    String command = request.getParameter("command");
    String name=request.getParameter("name");
  %>
  Command is <%= command %><br>
  Name is: <%= name %><br>
  </body>
  </html>
  ----------------------------

  server.xml defines context "localhost" and sets up ajp13
  httpd.conf jkmount's jsps to ajp13
  worker.properties set to point to the correct locations

  Hitting //localhost:8080/form.jsp, entering something which
    then displays //localhost:8080/process_form.jsp correctly
    displays the value of the input field ("name") and the
    hidden field ("command").

  Hitting //localhost/form.jsp, entering something and then
    on to //localhost/process_form.jsp displays nulls for
    "name" and "command".

  In both cases, the "content type" is reported as 
    "application/x-www-form-urlencoded"

  As might be expected, if I change the method to "get" instead
    of put, things work fine.  But that is not practical for
    my larger application.


  Almost a year ago, somebody else reported the same problem
    (see here:
   
http://www.mail-archive.com/tomcat-user@jakarta.apache.org/msg10905.html
    )
    but I did not see any solutions in the archives.

  Any ideas?  I'm most confused by the fact that it works on Linux
  and not on Windows.


Byron Frank
NuRelm
brf@nurelm.com

--
To unsubscribe:   <ma...@jakarta.apache.org>
For additional commands: <ma...@jakarta.apache.org>
Troubles with the list: <ma...@jakarta.apache.org>