"André Warnier" <a...@ice-sa.com> wrote:

>Jose María Zaragoza wrote:
>> Hello:
>> 
>> I've got a concept doubt about if it's possible perform many calls to
>> the same servlet ( on the same session ) if the previous one didn't
>> finish.
>
>Can you explain how precisely you would do that ?

See below. I'd expect browsers to support this out of the box.

>> I know that a connection is assigned to a thread.
>> If the client doesn't open more connection ( Keep-Alive: true ),

Even with keep-alive enabled browsers will open multiple connections (for 
speed) by default.

>> all requests are processed by the same thread.
>
>Yes, but I am curious how you would make a browser send several
>requests in a row on the 
>same connection, without waiting for the first request to return a
>response.

It is called HTTP pipe-lining and Tomcat supports it (and has done for as long 
as I can remember).

>> And if a request spends a lot of time when calling a servlet , is
>> that thread blocked until the servlet finish ? 
>
>Yes.  One thread handles one request at a time.
>But several threads can be running the same servlet code,
>independently.
>
>or each request is
>> processed by a new created thread ?
>
>Only if the new request comes in through another connection.
>
>> This is my doubt : is that the right behaviour ?
>> 
>> I know that there is a only one instance by servlet, but I'm talking
>> about one scenario with only one browser and only one session web

The behaviour will be as you describe *if* the client only uses one thread but 
most clients will use multiple threads.

>Mmm. That's a bit obscure.
>
>> 
>> If anyone knows about a good documentation about this question, that
>> would be helpful for me
>> 
>
>The HTTP RFC (#2616 ?), and the Java Servlet Specification.

For this, RFC2616 (that is correct) is likely to be the better reference.

Mark


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

Reply via email to