> 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]
