tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Konstantin Kolinko <>
Subject Re: clarification on how data is streamed and handled by tomcat
Date Wed, 04 Jan 2012 18:03:19 GMT
2012/1/4 S Ahmed <>:
> Say I have a simple servlet or spring mvc application running on tomcat.
> Tomcat is running as a webserver on port 80.
> A client makes a http POST request to my page
> If the client adds a very large file with the POST, does this mean that
> when my servlet code starts to execute, tomcat already has the entire
> request content in memory? (including the very large POST parameter)

1. Tomcat version =?
2. What API are you using to read the file?

In general request processing starts after the headers in HTTP request
have been read. At that point you can call getInputStream() and read
the body of the POST request while it is being received from the

But if you call certain APIs (e.g. getParameter()) the call will hang
until entire POST request body is received from the client and
processed. It is said that those methods "consume" the body of a POST

3. In most implementations large file uploads are not stored in
memory, but are written to a temporary file on your hard drive. (So
the request body is processed, but you cannot say that it is "in

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message