RE: Struts 2 Initialization Plugin

2011-11-11 Thread Scott Smith
Thanks for all the great suggestions. I think the spring suggestions will work best for what I want. -Original Message- From: Ken McWilliams [mailto:ken.mcwilli...@gmail.com] Sent: Thursday, November 10, 2011 1:40 PM To: user@struts.apache.org Subject: Re: Struts 2 Initialization

Re: Struts 2 Initialization Plugin

2011-11-10 Thread Ken McWilliams
The better solution is dependency injection with Spring, use the struts2-spring-plugin. On Thu, 2011-11-10 at 15:09 -0500, Eric Reed wrote: > You should have an initialization servlet run at startup that can create such > an object. > > > >>> Scott Smith 11/10/2011 3:06 PM >>> > In struts 1, I

Re: Struts 2 Initialization Plugin

2011-11-10 Thread Ken McWilliams
The better solution is dependency injection with Spring, use the struts2-spring-plugin. On Thu, 2011-11-10 at 15:09 -0500, Eric Reed wrote: > You should have an initialization servlet run at startup that can create such > an object. > > > >>> Scott Smith 11/10/2011 3:06 PM >>> > In struts 1, I

Re: Struts 2 Initialization Plugin

2011-11-10 Thread Li Ying
I think lazy initialization is a simple choice, because it is not dependent on the J2EE container, this make your code easy to test. If you worry about duplicated-initialization triggered by multi request, the simple solution is, make your initialization code [synchronized], using reserved word [s

Re: Struts 2 Initialization Plugin

2011-11-10 Thread Maurizio Cucchiara
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

Re: Struts 2 Initialization Plugin

2011-11-10 Thread Chris Pratt
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 wrote: > In struts 1, I used org.apache.struts.action.PlugIn as a way to create an > object at web

Re: Struts 2 Initialization Plugin

2011-11-10 Thread Eric Reed
You should have an initialization servlet run at startup that can create such an object. >>> Scott Smith 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

Struts 2 Initialization Plugin

2011-11-10 Thread Scott Smith
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 g