• 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

Struts2: Best way to execute application init process ?

 
Ranch Hand
Posts: 49
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi, Does anyone have any thoughts on what the best way to ensure an application initialization process starts off when the application loads or is first accessed?

I have the need to create a simple global cache and thread for persisting the cache and I need it to be readily available as early as possible.

The only way I could think to accomplish this would be to implement an interceptor to put in the interceptor stack of every action, and then put a check in there to see if my init process has run, prior to any actions being executed.

This solution seemed inherently crappy. haha... Anyone have a better way of doing this so I don't have to intercept every single action for the life of the app when I only need to run the process the first time?

Thanks!
Aaron
 
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You can use struts plug-in in struts 1, which load the neccessary file when server starts up.

But i don't know how to load some cache in struts2 while server starts up, as in struts2 plug-in class has been removed.
Can anybody help me.
Thanks in advanced.
Partha
 
World domination requires a hollowed out volcano with good submarine access. Tiny ads are optional.
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic