RE: One-time initializing in struts
If you're using a Servlet 2.3 container, I'd recommend using a ServletContextListener over a StartupServlet. I recently changed my apps to use this, and it was pretty simple to do. After all, that's what the SCL was designed for. As an example: http://tinyurl.com/7elp HTH, Matt > -Original Message- > From: Scott Barr [mailto:[EMAIL PROTECTED] > Sent: Wednesday, March 12, 2003 11:39 PM > To: Struts Users Mailing List > Subject: RE: One-time initializing in struts > > > > Hi Karl > > I use a Servlet to do app initialisation. > Add the Servlet to web.xml, and set the load-on-startup > parameter. Then > you put the initialisation code in the Servlet, and you're away. > > Scott Barr > www.exergonic.com.au > > > On Thu, 2003-03-13 at 17:05, Andrew Hill wrote: > > Struts PlugIn might be the best option for that. Check the > docs. Dont think > > its supported in 1.0 though, just 1.1. (With each 1.1.x > version having a > > different interface!) > > > > -Original Message- > > From: Karl [mailto:[EMAIL PROTECTED] > > Sent: Thursday, 13 March 2003 14:26 > > To: Struts Users Mailing List > > Subject: One-time initializing in struts > > > > > > Is there a way to do one-time initialization in struts > without having to put > > check logicn in every action? > > > > I want to use turbine as my persistance back-end but I need to call > > Torque.init("Torque.properties"); somewhere. > > > > > > > - > > 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] > > > > > - > 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: One-time initializing in struts
You might want to try extending ActionServlet and calling your torque.init stuff in your new ActionServlet.init. Something like this: MyActionServlet extends ActionServlet{ init(){ super.init; Torque.init("Torque.properties"); } } BAL From: "Andrew Hill" <[EMAIL PROTECTED]> Reply-To: <[EMAIL PROTECTED]> To: "Struts Users Mailing List" <[EMAIL PROTECTED]> Subject: RE: One-time initializing in struts Date: Thu, 13 Mar 2003 14:35:16 +0800 Struts PlugIn might be the best option for that. Check the docs. Dont think its supported in 1.0 though, just 1.1. (With each 1.1.x version having a different interface!) -Original Message- From: Karl [mailto:[EMAIL PROTECTED] Sent: Thursday, 13 March 2003 14:26 To: Struts Users Mailing List Subject: One-time initializing in struts Is there a way to do one-time initialization in struts without having to put check logicn in every action? I want to use turbine as my persistance back-end but I need to call Torque.init("Torque.properties"); somewhere. - 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] _ MSN 8 helps eliminate e-mail viruses. Get 2 months FREE*. http://join.msn.com/?page=features/virus - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: One-time initializing in struts
Hi Karl I use a Servlet to do app initialisation. Add the Servlet to web.xml, and set the load-on-startup parameter. Then you put the initialisation code in the Servlet, and you're away. Scott Barr www.exergonic.com.au On Thu, 2003-03-13 at 17:05, Andrew Hill wrote: > Struts PlugIn might be the best option for that. Check the docs. Dont think > its supported in 1.0 though, just 1.1. (With each 1.1.x version having a > different interface!) > > -Original Message- > From: Karl [mailto:[EMAIL PROTECTED] > Sent: Thursday, 13 March 2003 14:26 > To: Struts Users Mailing List > Subject: One-time initializing in struts > > > Is there a way to do one-time initialization in struts without having to put > check logicn in every action? > > I want to use turbine as my persistance back-end but I need to call > Torque.init("Torque.properties"); somewhere. > > > - > 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] > - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: One-time initializing in struts
Struts PlugIn might be the best option for that. Check the docs. Dont think its supported in 1.0 though, just 1.1. (With each 1.1.x version having a different interface!) -Original Message- From: Karl [mailto:[EMAIL PROTECTED] Sent: Thursday, 13 March 2003 14:26 To: Struts Users Mailing List Subject: One-time initializing in struts Is there a way to do one-time initialization in struts without having to put check logicn in every action? I want to use turbine as my persistance back-end but I need to call Torque.init("Torque.properties"); somewhere. - 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]