File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

does struts provide a init() method like servlet does

 
Yuhong Qian
Greenhorn
Posts: 5
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,

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.


Thanks

Yhqian99


 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic