At 4:16 PM -0600 8/9/05, C.F. Scheidecker Antunes wrote:
Hello all,

I would like to have a bean with a data structure that gets populated when the application starts and then this bean is available to the entire application. The data structure will get populated via a data base. I need to call the database just once to populate the data structure. In case the database changes I would restart the server and have this bean populated again. Hence all the sessions can query the data structure within this bean. How can I achieve this?

If you are using Servlet 2.3 or newer, you should probably use javax.servlet.ServletContextListener; If you are still using Servlet 2.2, or if your initialization process needs access to a specific Struts ModuleConfig, then use org.apache.struts.action.PlugIn

Details of ServletContextListener should be in any decent Servlet Reference. Details on PlugIn can be found here:

http://struts.apache.org/userGuide/building_controller.html#plugin_classes
http://struts.apache.org/userGuide/configuration.html#plugin_config
http://struts.apache.org/api/org/apache/struts/action/PlugIn.html

Joe

--
Joe Germuska [EMAIL PROTECTED] http://blog.germuska.com "Narrow minds are weapons made for mass destruction" -The Ex

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

Reply via email to