• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

does struts provide a init() method like servlet does

 
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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


 
Author
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
reply
    Bookmark Topic Watch Topic
  • New Topic