" 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. "

So this means if you don't reference request.getParameter then it won't be
streamed from the client?

The reason I am asking is I will perform api usage limites, and it would be
great if I don't have to bring in the entire request header + body if I can
get away with it.

On Wed, Jan 4, 2012 at 1:58 PM, André Warnier <a...@ice-sa.com> wrote:

> S Ahmed wrote:
>
>> Tomcat 6
>> Spring MVC, where my controllers method has both httpservletrequest and
>> httpservletresponse as parameters.
>>
>> The point is that I want to know the effects of others sending me large
>> values in a http post (not an image upload, but a form post).
>>
>> I'm assuming once it is sent by the client as a http post, and my servlet
>> responds to the request tomcat has already streamed that data and whether
>> I
>> do:
>>
>> String p1 = request.getParameter("big_**payload")
>>
>> or not, it has already been loaded into memory.
>>
>> Am I correct?
>>
>
> To me, it seems that Konstantin already answered those questions precisely
> and in detail below.
>
>
>
>> Is there a maximize size setting in tomcat?
>>
>> On Wed, Jan 4, 2012 at 1:03 PM, Konstantin Kolinko
>> <knst.koli...@gmail.com>wrote:
>>
>>  2012/1/4 S Ahmed <sahmed1...@gmail.com>:
>>>
>>>> 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 www.example.com/submit
>>>>
>>>> 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
>>> client.
>>>
>>> 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
>>> request.
>>>
>>> 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
>>> memory").
>>>
>>> ------------------------------**------------------------------**
>>> ---------
>>> To unsubscribe, e-mail: 
>>> users-unsubscribe@tomcat.**apache.org<users-unsubscr...@tomcat.apache.org>
>>> For additional commands, e-mail: users-h...@tomcat.apache.org
>>>
>>>
>>>
>>
>
> ------------------------------**------------------------------**---------
> To unsubscribe, e-mail: 
> users-unsubscribe@tomcat.**apache.org<users-unsubscr...@tomcat.apache.org>
> For additional commands, e-mail: users-h...@tomcat.apache.org
>
>

Reply via email to