In the web.xml you can specify a listener that is called when the application is started (This is part of the servlet 2.3 specs). The same listener can be used at the moment the application is closed
mvg Klaas ----- Original Message ----- From: "Simen Brekken" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Wednesday, April 02, 2003 8:40 AM Subject: Re: [Mav-user] Hibernate questions > I am still a bit unclear on what the best approach to this might be, if > anyone has any examples I'd be very grateful > > ----- Original Message ----- > From: "Schnitzer, Jeff" <[EMAIL PROTECTED]> > To: <[EMAIL PROTECTED]> > Sent: Wednesday, March 26, 2003 12:55 AM > Subject: RE: [Mav-user] Hibernate questions > > > > From: Simen Brekken [mailto:[EMAIL PROTECTED] > > > > I was wondering if there's anyway of performing the expensive > Hibernate > > initialization steps (init datastores, setup factories) somewhere > other > > than > > perform using a ThrowAway controller. > > Create an Initialize servlet that is load-on-startup'd before everything > else. You can store datastores, factories, etc in the application > attribute context or just as static members of the Initialize servlet. > > > Also, what's the benefit of using a ThrowAway over a singleton > controller? > > I think this is really just a question of taste. For many simple > applications, the ThrowawayBean controllers are an easy way to build a > lot of program logic with a single class. However, when you find that > you have a common form used in different commands, the inheritance chain > this requires tends to get ugly. It is often more convenient to use a > FormBeanUser style of controller in this case. > > In CVS right now there are two versions of friendbook-jsp, one which has > ThrowawayBean2 controllers and one which has FormBeanUser controllers. > > Personally my preference has been to use ThrowawayFormBeanUser as a base > controller class - it provides the best of both worlds, IMHO. > > Jeff Schnitzer > [EMAIL PROTECTED] > > > ------------------------------------------------------- > This SF.net email is sponsored by: > The Definitive IT and Networking Event. Be There! > NetWorld+Interop Las Vegas 2003 -- Register today! > http://ads.sourceforge.net/cgi-bin/redirect.pl?keyn0001en > [INVALID FOOTER] > > > > ------------------------------------------------------- > This SF.net email is sponsored by: ValueWeb: > Dedicated Hosting for just $79/mo with 500 GB of bandwidth! > No other company gives more support or power for your dedicated server > http://click.atdmt.com/AFF/go/sdnxxaff00300020aff/direct/01/ > [INVALID FOOTER] > ------------------------------------------------------- This SF.net email is sponsored by: ValueWeb: Dedicated Hosting for just $79/mo with 500 GB of bandwidth! No other company gives more support or power for your dedicated server http://click.atdmt.com/AFF/go/sdnxxaff00300020aff/direct/01/ [INVALID FOOTER]
