On Fri, 6 Jun 2003, Erik Price wrote:

> Date: Fri, 06 Jun 2003 10:36:40 -0400
> From: Erik Price <[EMAIL PROTECTED]>
> Reply-To: Struts Users Mailing List <[EMAIL PROTECTED]>
> To: Struts Users Mailing List <[EMAIL PROTECTED]>
> Subject: Re: question about struts
>
>
>
> Andrew Hill wrote:
> > The differences are not much - both are probably equally usuable in this
> > case.
> >
> > The advantages to using the struts plugin are that it gives you access to
> > struts configuration information, and that you can control the order in
> > which your plugins are initialised from struts-config.
>
> Does the access to the struts-config occur in a static initializer block
>   or method?  Or does it occur in an instance-specific block of code
> (constructor, instance method, non-static initializer, etc).
>

The struts-config.xml file is processed when the init() method of the
ActionServlet class is called.  In turn, that happens at one of the
following times:

* If you have declared a <load-on-startup> element in web.xml,
  this will happen before the web application is made available
  for use by clients.

* If you have not declared a <load-on-startup> element in web.xml,
  this will happen on the first request with a URL that is mapped
  to the Struts controller servlet (typically something like foo.do).

If you are in a Servlet 2.3 (or later) environment, using a
ServletContextListener is the guaranteed way to ensure that your
initialization code is run prior to application startup.  Struts 1.1 is
still compatible with Servlet 2.2, however, so this was not an option
available to Struts itself.

>
>
> Erik

Craig McClanahan

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

Reply via email to