You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by OTA_DZ <ko...@yahoo.fr> on 2008/07/24 10:17:08 UTC

Configuration in the loading of the application

Hi,
I’m new in Struts 2 and I want to do some configuration (log4j, DataBase,…)
in the loading of my application. In Struts 1 I use an implementation of
PlugIn and do these configurations in init() method. Could you please help
me?
Best Regards,

OTA_DZ.

-- 
View this message in context: http://www.nabble.com/Configuration-in-the-loading-of-the-application-tp18627314p18627314.html
Sent from the Struts - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: Configuration in the loading of the application

Posted by Antonio Petrelli <an...@gmail.com>.
2008/7/24 OTA_DZ <ko...@yahoo.fr>:
>
> Hi,
> I'm new in Struts 2 and I want to do some configuration (log4j, DataBase,…)
> in the loading of my application. In Struts 1 I use an implementation of
> PlugIn and do these configurations in init() method. Could you please help
> me?

You can use a ServletContextListener:
http://java.sun.com/javaee/5/docs/api/javax/servlet/ServletContextListener.html
Obviously you have to configure it in web.xml:
http://www.java-tips.org/java-ee-tips/java-servlet/how-to-work-with-servletcontextlistener.html

HTH
Antonio

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org