does struts provide a init() method like servlet does
posted 6 years ago
I am transfering my web application from servlet to struts1.2. In one of my servlet init() method I created a thread to do some work on the background, and I need to keep the same thing in struts appliaction. How can I do this? does struts provide a init() method like servlet does.
Why are you moving from servlets to a nearly-as-old technology? Doesn't seem like a good idea to me.
In any case, if you need to start a thread on application startup, it'd be better to use an application context listener, or maybe a Struts plugin--but I'd try to decouple it from Struts, particularly Struts 1, as much as possible. No real reason to move that out of default app container stuff.