Re: Initialization stuff

2004-07-14 Thread Martin I. Levi
Got it. Thanks!

On Tue, 2004-07-13 at 15:44, Emmanouil Batsis wrote:
> Martin I. Levi wrote:
> 
> > Is this a better solution than mine?
> 
> Although I often use servlets for initialization, Paul's suggestion is 
> better because ServletContextListener was designed exactly for 
> initialization/finalization purposes.
> 
> Using the right tool for the job is a good practice even if you gain 
> nothing more in functionality; it makes your application 
> components/logic easier to identify later.
> 
> So i guess I should refactor too ;-)
> 
> Manos
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
-- 
Saludos,

Martin I. Levi

Centre Tecnològic de Transferenciència de Calor
Universitat Politècnica de Catalunya
www.cttc.upc.edu


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



Re: Initialization stuff

2004-07-13 Thread Bill Siggelkow
Martin,
I would not override the ActionServlet -- the plug-in approach is much 
better and not hard at all.

Here is a simple plug in and the
Martin I. Levi wrote:
Is this a better solution than mine?

On Tue, 2004-07-13 at 14:06, Paul McCulloch wrote:
You can do this by creating a class which implements
javax.servlet.ServletContextListener.
This requires a container supporting Servlet 2.3.
Paul

-Original Message-
From: Martin I. Levi [mailto:[EMAIL PROTECTED]
Sent: 13 July 2004 12:47
To: Struts Users Mailing List
Subject: Initialization stuff
Hi!
I would like to call an initialization class when my web 
application is
loaded in the container to perform some extra init tasks. How should I
do this?
My idea was to subclass the ActionServlet and override the 
init method,
is this ok or is there a better way to do this?

Any help is welcome.
Thanks!
--
Saludos,
Martin I. Levi
Centre Tecnològic de Transferenciència de Calor
Universitat Politècnica de Catalunya
www.cttc.upc.edu
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

**
Axios Email Confidentiality Footer
Privileged/Confidential Information may be contained in this message. If you are not 
the addressee indicated in this message (or responsible for delivery of the message to 
such person), you may not copy or deliver this message to anyone. In such case, you 
should destroy this message, and notify us immediately. If you or your employer does 
not consent to Internet email messages of this kind, please advise us immediately. 
Opinions, conclusions and other information expressed in this message are not given or 
endorsed by my Company or employer unless otherwise indicated by an authorised 
representative independent of this message.
WARNING:
While Axios Systems Ltd takes steps to prevent computer viruses from being transmitted 
via electronic mail attachments we cannot guarantee that attachments do not contain 
computer virus code.  You are therefore strongly advised to undertake anti virus 
checks prior to accessing the attachment to this electronic mail.  Axios Systems Ltd 
grants no warranties regarding performance use or quality of any attachment and 
undertakes no liability for loss or damage howsoever caused.
**
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

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


RE: Initialization stuff

2004-07-13 Thread Martin I. Levi
Yeah, but I just need to do initialization when the application starts,
the validator and tiles are working all the time when requests come and
go. Perhaps is a good solution also, but is mine wrong or discouraged?
Thats what i really would like to know.

On Tue, 2004-07-13 at 13:58, Matthias Wessendorf wrote:
> Perhaps you can write a Plugin
> 
> that is the way how tiles and Validator gets init.
> 
> http://struts.apache.org/api/org/apache/struts/action/PlugIn.html
> 
> regards
> 
> > -Original Message-
> > From: Martin I. Levi [mailto:[EMAIL PROTECTED] 
> > Sent: Tuesday, July 13, 2004 1:47 PM
> > To: Struts Users Mailing List
> > Subject: Initialization stuff
> > 
> > 
> > Hi!
> > 
> > I would like to call an initialization class when my web 
> > application is loaded in the container to perform some extra 
> > init tasks. How should I do this? My idea was to subclass the 
> > ActionServlet and override the init method, is this ok or is 
> > there a better way to do this?
> > 
> > Any help is welcome.
> > 
> > Thanks!
> > 
> > -- 
> > Saludos,
> > 
> > Martin I. Levi
> > 
> > Centre Tecnològic de Transferenciència de Calor
> > Universitat Politècnica de Catalunya
> > www.cttc.upc.edu
> > 
> > 
> > -
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> > 
> 
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
-- 
Saludos,

Martin I. Levi

Centre Tecnològic de Transferenciència de Calor
Universitat Politècnica de Catalunya
www.cttc.upc.edu


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



Re: Initialization stuff

2004-07-13 Thread Emmanouil Batsis
Martin I. Levi wrote:
Is this a better solution than mine?
Although I often use servlets for initialization, Paul's suggestion is 
better because ServletContextListener was designed exactly for 
initialization/finalization purposes.

Using the right tool for the job is a good practice even if you gain 
nothing more in functionality; it makes your application 
components/logic easier to identify later.

So i guess I should refactor too ;-)
Manos
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


RE: Initialization stuff

2004-07-13 Thread Martin I. Levi
Is this a better solution than mine?

On Tue, 2004-07-13 at 14:06, Paul McCulloch wrote:
> You can do this by creating a class which implements
> javax.servlet.ServletContextListener.
> 
> This requires a container supporting Servlet 2.3.
> 
> Paul
> 
> > -Original Message-
> > From: Martin I. Levi [mailto:[EMAIL PROTECTED]
> > Sent: 13 July 2004 12:47
> > To: Struts Users Mailing List
> > Subject: Initialization stuff
> > 
> > 
> > Hi!
> > 
> > I would like to call an initialization class when my web 
> > application is
> > loaded in the container to perform some extra init tasks. How should I
> > do this?
> > My idea was to subclass the ActionServlet and override the 
> > init method,
> > is this ok or is there a better way to do this?
> > 
> > Any help is welcome.
> > 
> > Thanks!
> > 
> > -- 
> > Saludos,
> > 
> > Martin I. Levi
> > 
> > Centre Tecnològic de Transferenciència de Calor
> > Universitat Politècnica de Catalunya
> > www.cttc.upc.edu
> > 
> > 
> > -
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> > 
> 
> 
> **
> Axios Email Confidentiality Footer
> Privileged/Confidential Information may be contained in this message. If you are not 
> the addressee indicated in this message (or responsible for delivery of the message 
> to such person), you may not copy or deliver this message to anyone. In such case, 
> you should destroy this message, and notify us immediately. If you or your employer 
> does not consent to Internet email messages of this kind, please advise us 
> immediately. Opinions, conclusions and other information expressed in this message 
> are not given or endorsed by my Company or employer unless otherwise indicated by an 
> authorised representative independent of this message.
> WARNING:
> While Axios Systems Ltd takes steps to prevent computer viruses from being 
> transmitted via electronic mail attachments we cannot guarantee that attachments do 
> not contain computer virus code.  You are therefore strongly advised to undertake 
> anti virus checks prior to accessing the attachment to this electronic mail.  Axios 
> Systems Ltd grants no warranties regarding performance use or quality of any 
> attachment and undertakes no liability for loss or damage howsoever caused.
> **
> 
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
-- 
Saludos,

Martin I. Levi

Centre Tecnològic de Transferenciència de Calor
Universitat Politècnica de Catalunya
www.cttc.upc.edu


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



RE: Initialization stuff

2004-07-13 Thread Paul McCulloch
You can do this by creating a class which implements
javax.servlet.ServletContextListener.

This requires a container supporting Servlet 2.3.

Paul

> -Original Message-
> From: Martin I. Levi [mailto:[EMAIL PROTECTED]
> Sent: 13 July 2004 12:47
> To: Struts Users Mailing List
> Subject: Initialization stuff
> 
> 
> Hi!
> 
> I would like to call an initialization class when my web 
> application is
> loaded in the container to perform some extra init tasks. How should I
> do this?
> My idea was to subclass the ActionServlet and override the 
> init method,
> is this ok or is there a better way to do this?
> 
> Any help is welcome.
> 
> Thanks!
> 
> -- 
> Saludos,
> 
> Martin I. Levi
> 
> Centre Tecnològic de Transferenciència de Calor
> Universitat Politècnica de Catalunya
> www.cttc.upc.edu
> 
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 


**
Axios Email Confidentiality Footer
Privileged/Confidential Information may be contained in this message. If you are not 
the addressee indicated in this message (or responsible for delivery of the message to 
such person), you may not copy or deliver this message to anyone. In such case, you 
should destroy this message, and notify us immediately. If you or your employer does 
not consent to Internet email messages of this kind, please advise us immediately. 
Opinions, conclusions and other information expressed in this message are not given or 
endorsed by my Company or employer unless otherwise indicated by an authorised 
representative independent of this message.
WARNING:
While Axios Systems Ltd takes steps to prevent computer viruses from being transmitted 
via electronic mail attachments we cannot guarantee that attachments do not contain 
computer virus code.  You are therefore strongly advised to undertake anti virus 
checks prior to accessing the attachment to this electronic mail.  Axios Systems Ltd 
grants no warranties regarding performance use or quality of any attachment and 
undertakes no liability for loss or damage howsoever caused.
**


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



RE: Initialization stuff

2004-07-13 Thread Matthias Wessendorf
Perhaps you can write a Plugin

that is the way how tiles and Validator gets init.

http://struts.apache.org/api/org/apache/struts/action/PlugIn.html

regards

> -Original Message-
> From: Martin I. Levi [mailto:[EMAIL PROTECTED] 
> Sent: Tuesday, July 13, 2004 1:47 PM
> To: Struts Users Mailing List
> Subject: Initialization stuff
> 
> 
> Hi!
> 
> I would like to call an initialization class when my web 
> application is loaded in the container to perform some extra 
> init tasks. How should I do this? My idea was to subclass the 
> ActionServlet and override the init method, is this ok or is 
> there a better way to do this?
> 
> Any help is welcome.
> 
> Thanks!
> 
> -- 
> Saludos,
> 
> Martin I. Levi
> 
> Centre Tecnològic de Transferenciència de Calor
> Universitat Politècnica de Catalunya
> www.cttc.upc.edu
> 
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 


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