RE: need request lifecycle diagram

2002-12-01 Thread Reynir Hübner
Hi aaron, 

To answer your questions directly, I don't know if a diagram as you want exists, but 
yes it's a good idea. 
In my understanding the row is like this : 

1. HTTP service receives the request. 
2. If an authentication valve is set to handle the authentication it will happen next, 
as it is a part of the HTTP.
3. Valves are before filters. Logging, etc before filters. 
4. Filters can run before servlets/jsps.  
5. Servlets and JSPs (sometimes using jsp-tags) create the response. 
6. Filters can run after servlets/jsps. 
7. The response is sent back to the http client that made the request.


Listeners, are a different thing. These are made so that you have an event when 
something happenes in the servlet context or sessions.
You can implement a listener if you want to for example do something when a servlet 
context is created, or an attribute is inserted into the servlet context 
(ServletContextListener). The other listeners are made for similar things. 

The authentication can differ between HTTP servers/clients, for example the IIS 
Windows Intergrated Authentication is not request based authentication but a 
connection based, using some magick to make that happen. 

Hope this helps, 
-reynir




 -Original Message-
 From: AAron nAAs [mailto:[EMAIL PROTECTED]] 
 Sent: 30. nóvember 2002 16:14
 To: [EMAIL PROTECTED]
 Subject: need request lifecycle diagram
 
 
 Does anyone know of a good request lifecycle diagram showing 
 all the steps 
 in satisfying a Java Server request?
 
 I'd like to see the exact ordering of all the components that 
 a request goes 
 through such as Authentication, Filters, Listeners, Valves, 
 etc... Either a 
 vendor specific or a generic Java Server diagram would suffice.
 
 Everything I've found so far talks about one of these at a 
 time, so the big 
 picture is never revealed. I want to know, for instance, if 
 filters are 
 applied before or after authentication.
 
 Thanks,
 -AAron
 
 _
 Add photos to your e-mail with MSN 8. Get 2 months FREE*. 
 http://join.msn.com/?page=features/featuredemail
 
 
 --
 To unsubscribe, e-mail:   
 mailto:tomcat-user- [EMAIL PROTECTED]
 For 
 additional commands, 
 e-mail: mailto:[EMAIL PROTECTED]
 
 

--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]




Re: need request lifecycle diagram

2002-12-01 Thread Craig R. McClanahan


On Sat, 30 Nov 2002, AAron nAAs wrote:

 Date: Sat, 30 Nov 2002 11:14:22 -0500
 From: AAron nAAs [EMAIL PROTECTED]
 Reply-To: Tomcat Users List [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]
 Subject: need request lifecycle diagram

 Does anyone know of a good request lifecycle diagram showing all the steps
 in satisfying a Java Server request?

 I'd like to see the exact ordering of all the components that a request goes
 through such as Authentication, Filters, Listeners, Valves, etc... Either a
 vendor specific or a generic Java Server diagram would suffice.



Here's a brief list for Tomcat 4 standalone (if you're behind a web server
there are some additional stages before and after) here's a brief summary
of the lifecycle's stages:

* Connector -- receives HTTP connection from client browser,
  dispatches request to the associated Engine.

* Engine -- runs all Valves nested in the Engine, including
  one that dispatches the request to the appropriate Host
  based on the requested host name.

* Host -- runs all Valves nested in the Host, including
  one that dispatches the request to the appropriate Context,
  based on the requested context path

* Context -- runs all Valves nested in the Context, including
  one that dispatches the request to the appropriate servlet
  Wrapper, based on the servlet mapping that matches.

* Wrapper -- loads the servlet (and calls init() if needed).
  Runs all the filters mapped to this request URI, followed
  by a call to the service() method of the servlet itself.

A couple of notes on interesting subtleties:

* Listeners aren't directly invoked as part of the request
  processing lifecycle for Tomcat 4 (although you can declare
  a ServletRequestListener in Tomcat 5 that will be invoked
  before the filters).

* A lot of Tomcat's standard processing features are implemented
  as Valves that are explicitly added (like the access log valve
  in the default configuration) or dynamically configured if
  necessary.  Authentication is an example of the latter -- at
  webapp startup time, Tomcat looks at your web.xml file and (if
  you've specified a login method) adds an appropriate Authenticator
  valve to the list of valves run at the Context level.

* If your app uses a request dispatcher, you'll find that filters
  and authentication are *not* applied to the dispatched request.
  They are only applied on the original request from the client.

 Everything I've found so far talks about one of these at a time, so the big
 picture is never revealed. I want to know, for instance, if filters are
 applied before or after authentication.

Based on the above information, we can see that filters are applied
*after* authentication, not before.


 Thanks,
 -AAron

Craig



 _
 Add photos to your e-mail with MSN 8. Get 2 months FREE*.
 http://join.msn.com/?page=features/featuredemail


 --
 To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
 For additional commands, e-mail: mailto:[EMAIL PROTECTED]




--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]




need request lifecycle diagram

2002-11-30 Thread AAron nAAs
Does anyone know of a good request lifecycle diagram showing all the steps 
in satisfying a Java Server request?

I'd like to see the exact ordering of all the components that a request goes 
through such as Authentication, Filters, Listeners, Valves, etc... Either a 
vendor specific or a generic Java Server diagram would suffice.

Everything I've found so far talks about one of these at a time, so the big 
picture is never revealed. I want to know, for instance, if filters are 
applied before or after authentication.

Thanks,
-AAron

_
Add photos to your e-mail with MSN 8. Get 2 months FREE*. 
http://join.msn.com/?page=features/featuredemail


--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]