You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Heligon Sandra <Sa...@nextream.fr> on 2002/07/03 11:06:52 UTC

Struts application initialisation workflow.

	
	Hi,

	Where can I find information about the application start-up sequence
diagram ?
	I need to know in which order struts components and servlet classes
are instantiated.
	For example if I use ServletContextListener, HttpSessionListener,
and a sub-class of RequestProcessor,
	which class is instantiated in first.
	Is the order  the same as the classes have been declared in the
web.xml file ?
	If the web.xml is configured in order to initialize the controller
servlet when the webapp starts up,
	Is the init() method of the ActionServlet responsible of listeners
instantiation? and when is the RequestProcessor
	instantiated in the init() too ?
	The processPreprocess() method is called for the first time when the
first request associated to an action arrive, is it true ?
	It is difficult to understand well the initialisation workflow but
it is important for developers. 
	Has somebody a documentation about that or the one solution is to
look at the struts source ?
	People which can reply to these questions are probably struts
developers, but I don't know if I can post
	such questions in the struts-dev mailing list.
	 
	Thanks a lot.

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


RE: Struts application initialisation workflow.

Posted by Robert Taylor <rt...@mulework.com>.
Many the questions you ask can be answered by understanding the current
servlet specification.
And as you already mentioned, many of the Struts initialization questions
can be answered by simply
looking at the RequestProcessor methods. I've seen other threads which
discuss in detail the initialization process. You may want to check the
archives.
http://www.mail-archive.com/struts-user%40jakarta.apache.org/

To answer your questions:

ServletContextListeners are defined in web.xml, are instantiated by the
container,
are invoked in the order in which they are defined in web.xml. Struts does
not manage
them. See Section 10.2 Servlet2.3 spec.
http://www.jcp.org/aboutJava/communityprocess/final/jsr053/

HttpSessionListeners are defined in web.xml, are instantiated by the
container, and
are invoked when the container creates or destroys a session and when a
session is invalidated.
Struts does not manage them. See Section 10.2 Servlet2.3 spec.

RequestProcessor subclasses are defined in struts-config.xml, are
instantiated by Struts,
and are invoked upon each request to the Struts framework.
See Struts 1.1 DTD
(http://jakarta.apache.org/struts/dtds/struts-config_1_1.dtd)
and RequestProcessor class.

processPreprocess() is always true, unless you override it.
See RequestProcessor class.

HTH,

robert

> -----Original Message-----
> From: Heligon Sandra [mailto:Sandra.Heligon@nextream.fr]
> Sent: Wednesday, July 03, 2002 5:07 AM
> To: 'struts-user@jakarta.apache.org'
> Subject: Struts application initialisation workflow.
>
>
>
> 	Hi,
>
> 	Where can I find information about the application start-up sequence
> diagram ?
> 	I need to know in which order struts components and servlet classes
> are instantiated.
> 	For example if I use ServletContextListener, HttpSessionListener,
> and a sub-class of RequestProcessor,
> 	which class is instantiated in first.
> 	Is the order  the same as the classes have been declared in the
> web.xml file ?
> 	If the web.xml is configured in order to initialize the controller
> servlet when the webapp starts up,
> 	Is the init() method of the ActionServlet responsible of listeners
> instantiation? and when is the RequestProcessor
> 	instantiated in the init() too ?
> 	The processPreprocess() method is called for the first time when the
> first request associated to an action arrive, is it true ?
> 	It is difficult to understand well the initialisation workflow but
> it is important for developers.
> 	Has somebody a documentation about that or the one solution is to
> look at the struts source ?
> 	People which can reply to these questions are probably struts
> developers, but I don't know if I can post
> 	such questions in the struts-dev mailing list.
>
> 	Thanks a lot.
>
> --
> To unsubscribe, e-mail:
> <ma...@jakarta.apache.org>
> For additional commands, e-mail:
> <ma...@jakarta.apache.org>
>


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


RE: Struts application initialisation workflow.

Posted by Rajesh Pradhan <Ra...@patni.com>.
Hi Heligon,
There are some very good documents at the http://husted.com/struts/ and also
u
can read the Struts API which also would really be useful.

There is also one UML diagram showing the whole flow of struts application.
if u want it .. i will fwd it to u.

bye.

cheers
Rajesh Pradhan



-----Original Message-----
From: Heligon Sandra [mailto:Sandra.Heligon@nextream.fr]
Sent: Wednesday, July 03, 2002 2:37 PM
To: 'struts-user@jakarta.apache.org'
Subject: Struts application initialisation workflow.



	Hi,

	Where can I find information about the application start-up sequence
diagram ?
	I need to know in which order struts components and servlet classes
are instantiated.
	For example if I use ServletContextListener, HttpSessionListener,
and a sub-class of RequestProcessor,
	which class is instantiated in first.
	Is the order  the same as the classes have been declared in the
web.xml file ?
	If the web.xml is configured in order to initialize the controller
servlet when the webapp starts up,
	Is the init() method of the ActionServlet responsible of listeners
instantiation? and when is the RequestProcessor
	instantiated in the init() too ?
	The processPreprocess() method is called for the first time when the
first request associated to an action arrive, is it true ?
	It is difficult to understand well the initialisation workflow but
it is important for developers.
	Has somebody a documentation about that or the one solution is to
look at the struts source ?
	People which can reply to these questions are probably struts
developers, but I don't know if I can post
	such questions in the struts-dev mailing list.

	Thanks a lot.

--
To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
For additional commands, e-mail:
<ma...@jakarta.apache.org>


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>