Tomcat , filter and persistent connections

Discussion in 'Java' started by pvsnmp@yahoo.com, Dec 3, 2005.

  1. Guest

    Hi,
    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?

    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?

    rgds,
    Prashant
     
    , Dec 3, 2005
    #1
    1. Advertising

  2. Guest

    wrote:
    > Hi,
    > 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?
    >
    > 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?
    >
    > rgds,
    > Prashant
     
    , Dec 3, 2005
    #2
    1. Advertising

  3. Chris Smith Guest

    <> 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
     
    Chris Smith, Dec 3, 2005
    #3
  4. Guest

    >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.
    >Chris Smith - Lead Software Developer/Technical Trainer
    >MindIQ Corporation


    Hi,
    Thanks very much for the explanation

    rgds,
    Prashant
     
    , Dec 3, 2005
    #4
  5. Chris Smith Guest

    <> wrote:
    > >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.


    > Thanks very much for the explanation


    I'm afraid I was a little inaccurate, though. Let me expand. The
    IOException will be thrown on the next attempt to read from or write to
    the underlying sockets. That may or may not be the next attempt to
    read/write the streams. If the streams are buffered, then the exception
    may occur at any point in the future.

    If you don't mind committing the response and you have some special
    reason that a disconnect may have occurred such as after a long delay,
    you could just flush the output stream to be sure.

    --
    www.designacourse.com
    The Easiest Way To Train Anyone... Anywhere.

    Chris Smith - Lead Software Developer/Technical Trainer
    MindIQ Corporation
     
    Chris Smith, Dec 3, 2005
    #5
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Jim Hubbard
    Replies:
    2
    Views:
    689
    Joerg Jooss
    Jan 21, 2005
  2. =?Utf-8?B?bWFuamk=?=

    ASP.net Debugger and Persistent Connections

    =?Utf-8?B?bWFuamk=?=, Aug 4, 2005, in forum: ASP .Net
    Replies:
    0
    Views:
    336
    =?Utf-8?B?bWFuamk=?=
    Aug 4, 2005
  3. Replies:
    0
    Views:
    1,012
  4. jobs
    Replies:
    2
    Views:
    903
  5. gk
    Replies:
    7
    Views:
    1,004
    Tom Anderson
    Oct 12, 2010
Loading...

Share This Page