Tomcat and sequence of events

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

  1. Guest

    Hi,
    I have a web application with a number of servlets. I am using Tomcat.
    I have configured a filter for the web application in its web.xml file.
    The url pattern which the filter will match is /*. The application
    servlets are present in ROOT directory, the default web application
    path. I have also enabled the invoker servlet. It matches the default
    url pattern /servlet/*.
    Can someone explain the sequence of events that happen as a request
    arrives for a servlet , with URL /servlet/xyz ? How does the filter
    know where to hand the request to when it reaches
    chain.doFilter(req,res) ? There are no other filters and none of the
    servlets are defined in the web.xml file, so its the invoker servlet
    which hands the request to servlets i guess. But how to the various
    components know what is to be done next???

    rgds,
    Prashant
     
    , Dec 4, 2005
    #1
    1. Advertisements

  2. <> schrieb im Newsbeitrag
    news:...
    > I have a web application with a number of servlets. I am using Tomcat.
    > I have configured a filter for the web application in its web.xml file.
    > The url pattern which the filter will match is /*. The application
    > servlets are present in ROOT directory, the default web application
    > path. I have also enabled the invoker servlet. It matches the default
    > url pattern /servlet/*.


    What do you mean by 'The application servlets are present in ROOT directory?

    > Can someone explain the sequence of events that happen as a request
    > arrives for a servlet , with URL /servlet/xyz ? How does the filter
    > know where to hand the request to when it reaches
    > chain.doFilter(req,res) ?


    Tomcat fist checks the first part of the url to find the correct web
    application (context).
    Then it executes all the registered listeners, if their URL pattern matches.
    Then it executes the servlet whose URL pattern matches.
    Then it returns the response through the filters back to the browser.

    > There are no other filters and none of the
    > servlets are defined in the web.xml file, so its the invoker servlet
    > which hands the request to servlets i guess. But how to the various
    > components know what is to be done next???


    That is what you specified in your web.xml. There are some more components,
    such as valves. They are Tomcat internal and probably not interesting for
    you.

    Hiran
     
    Hiran Chaudhuri, Dec 4, 2005
    #2
    1. Advertisements

  3. Guest

    >Tomcat fist checks the first part of the url to find the correct web
    >application (context).
    >Then it executes all the registered listeners, if their URL pattern matches.
    >Then it executes the servlet whose URL pattern matches.
    >Then it returns the response through the filters back to the browser.
    >Hiran


    Hi,
    what abt request going through filter?? How does the filter know where
    handout the request once its job is done ?? In my case i am not
    defining the servlets in the web.xml file.

    rgds,
    Prashant
     
    , Dec 5, 2005
    #3
    1. Advertisements

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. John Spiegel

    Sequence of events

    John Spiegel, Jan 3, 2005, in forum: ASP .Net
    Replies:
    4
    Views:
    2,608
    John Spiegel
    Jan 3, 2005
  2. John Dalberg

    Need to trace sequence of server events

    John Dalberg, Oct 4, 2006, in forum: ASP .Net
    Replies:
    1
    Views:
    395
    Mark Fitzpatrick
    Oct 5, 2006
  3. stef mientki
    Replies:
    13
    Views:
    973
    stef mientki
    Oct 20, 2007
  4. AAaron123
    Replies:
    2
    Views:
    492
    AAaron123
    Feb 11, 2009
  5. Chris

    Events Events Events Please Help

    Chris, Aug 30, 2005, in forum: ASP .Net Web Controls
    Replies:
    0
    Views:
    634
    Chris
    Aug 30, 2005
  6. Seth Williams

    Sequence of Events for Custom Control

    Seth Williams, Mar 31, 2008, in forum: ASP .Net Web Controls
    Replies:
    4
    Views:
    245
    Seth Williams
    Apr 2, 2008
  7. email55555 email55555

    [Tk] Multi-events sequence binding?

    email55555 email55555, Dec 16, 2004, in forum: Ruby
    Replies:
    3
    Views:
    189
    Hidetoshi NAGAI
    Dec 17, 2004
  8. Replies:
    4
    Views:
    277
    Dr John Stockton
    Jun 5, 2006
Loading...