On 12/11/07, sarat.pediredla <[EMAIL PROTECTED]> wrote: > > > Is there anyway to specify some code to run only when the web application > context starts up? I am using Appfuse 2 with Struts 2. > > Basically, I want my basic lucene index to be created the first time I > start > my application. I did think of putting this in an custom Struts 2 > Interceptor but I dont really want it to run on every page load. Same goes > for a filter inside web.xml. > > Is there anything inside struts 2 or the standard servlet spec which > allows > me to run startup code?
In AppFuse it is probably easier to do this using Spring. Just define a bean with an init method. The init method will be called when Spring initialises the bean. Mike. -- > View this message in context: > http://www.nabble.com/Running-some-code-at-startup-%28one-time-only%29-using-Struts-2-tp14274018s2369p14274018.html > Sent from the AppFuse - User mailing list archive at Nabble.com. > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > >
