That is how it is with every single request.
Tomcat will never read a body unless the servlet initiates the action.
So to read a body you can either
- read the input stream
- read the reader
- issue a request.getParameter (if the body is form encoded, tomcat will read the body and parse the parameters)

I'm not sure what the Expect/100-continue headers have anything to do with reading the body. As a servlet/JSP developers, you are the trigger for reading the body, without any exceptions.

Filip


Nathan Ashworth wrote:
What we are observing is: 1) Client initiates the POST with the 'Expect:
100-continue' header, 2) Tomcat responds with '100 Continue', 3) Tomcat
calls the servlet. Now once we are in our servlet, unless we explicitly read
from the request's BufferedReader, the client will not send the remainder of
the POST.

So, from my perspective, it looks like Tomcat is only handling half of the
POST, while it is up to to servlet to read and parse the other half. Is that
the expected process when dealing with 100-continue?


Filip Hanik - Dev Lists wrote:
if you use wireshark, you should see that Tomcat already does it automatically. if you look at the code StandardWrapperValve.java, it should call response.acknowledge(), and if the client sent an expect header, tomcat will write out the 100 continue
Filip

Nathan Ashworth wrote:
What's the simplest way to support Expect: 100-continue requests in a
servlet
running on Tomcat 6?

My current solution is to look for the "expect" header, check whether its
value is "100-continue" and if it is, then I get a BufferedReader from
the
request [request.getReader()] and dump the contents into a String. I then
parse that String into a parameter Map.

Now, this does work, but it feels like I am doing work that Tomcat should
be
handling transparently. Am I missing something here?

Thanks,

Nathan
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org






---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org

Reply via email to