tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject [Bug 60835] New: Inconsistent handling for POST and GET Parameter
Date Wed, 08 Mar 2017 10:44:24 GMT
https://bz.apache.org/bugzilla/show_bug.cgi?id=60835

            Bug ID: 60835
           Summary: Inconsistent handling for POST and GET Parameter
           Product: Tomcat 8
           Version: 8.5.x-trunk
          Hardware: All
                OS: All
            Status: NEW
          Severity: trivial
          Priority: P2
         Component: Catalina
          Assignee: dev@tomcat.apache.org
          Reporter: stefan.mocken@congstar.net
  Target Milestone: ----

POST Parameter are nulled when PrintWriter from response.getWriter() is closed,
before request.getParamter("id") is called.

Examlpe:

################################Servlet####################################

public void service(HttpServletRequest request, HttpServletResponse response)
throws Exception {


        PrintWriter wr = response.getWriter();
        wr.write("OK");
        wr.close();


        System.out.println("HTTP Method is: " + request.getMethod() + " " +
request.getParameter("id"));

}

#################################Servlet###################################

################################GET Curl###################################

curl -iv "http://127.0.0.1:8080/test/test?id=123"

################################GET Curl###################################

###############################POST Curl###################################

curl -iv --data "id=123" http://127.0.0.1:8080/test/test

###############################POST Curl###################################

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


Mime
View raw message