<> wrote:
> What will happen in the following scenario, A client establishes
> HTTP/1.1 persistent connection with Tomcat. The web application to
> which the request is destined has a filter configured .
> The client sends multiple requests over the same socket connection to
> Tomcat server. Will tomcat invoke the doFilter() method of the filter
> code multiple times for the different requests or will the Filter code
> also get the requests in a pipelined fashion?
The HTTP transport level is irrelevant in the behavior of a servlet
container with respect to servlets. Therefore, the Filter will be
invoked and complete separately for each request. Because the requests
are serialized on one connection, you do get the guarantee that each one
will complete before the next one. However, you really shouldn't design
for this condition.
> Another question is , a client sends a request to Tomcat, and the
> requested application has a filter configured for it, When the filter
> code is being executed if the client disconnects the connection to
> Tomcat , what will happen to the execution of filter code, will it
> stop?
What will typically happen (filter or not) is that an IOException will
be thrown on the next attempt to read from or write to the underlying
request/response streams.
--
www.designacourse.com
The Easiest Way To Train Anyone... Anywhere.
Chris Smith - Lead Software Developer/Technical Trainer
MindIQ Corporation