Look into the ServletContextListener interface.  It's a nice way to
initialize/dispose of one-time resources in any web app, Struts or not.
  (*Chris*)

On Thu, Nov 10, 2011 at 12:06 PM, Scott Smith <ssm...@mainstreamdata.com>wrote:

> In struts 1, I used org.apache.struts.action.PlugIn as a way to create an
> object at web app startup and put it into the application context so that
> all sessions had access to it.  What's the equivalent method in Struts2?
>  That is, how can I have an object created at web application startup.
>
> I guess the alternative is lazy initialization (first guy who tries to
> access it and doesn't find it, creates it, and saves it into the app
> context; down side is I might end up with several sessions trying to create
> it until one finally makes it to the app context).
>
> Any better solutions?
>

Reply via email to