You could take advantage of struts dependency injection [1].
You can use servlet filter or something else.
Generally this kind of things are easy to realize thank to the
interceptors facility.



[1] http://struts.apache.org/2.x/docs/bean-configuration.html
Maurizio Cucchiara



On 10 November 2011 21:09, Eric Reed <ere...@mail.nysed.gov> wrote:
> You should have an initialization servlet run at startup that can create such 
> an object.
>
>
>>>> Scott Smith <ssm...@mainstreamdata.com> 11/10/2011 3:06 PM >>>
> 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?
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
> For additional commands, e-mail: user-h...@struts.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org

Reply via email to