On 6/25/10 2:36 PM, hisameer wrote:
I have to implement a logic so that when the server starts I can
execute some database scripts using my DAO service layer.
implement a ServletContextListener that includes the method
contextInitialized(ServletContextEvent event).
You should be able to get access to your business logic objects using
getBean() method on the ApplicationContext. Those business logic beans
should have references to your DAO layer. It's inadvisable for web
layer code to directly access your DAOs.
ServletContext context = event.getServletContext();
ApplicationContext ctx =
WebApplicationContextUtils.getRequiredWebApplicationContext(context);
bean = (BeanClass)ctx.getBean(beanName);
-Dale
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org