Re: Struts 2 : application-wide values initialization.

2007-09-08 Thread Leonidas Papadakis
You can do the same with an application scope bean using spring . Create a simple pojo that initializes values on the constructor. Then add an entry to the applicationContext.xml file : beans bean id=myComp class=org.components.MyComponent singleton=true/ /beans Then in your java action

Re: Struts 2 : application-wide values initialization.

2007-09-08 Thread Gabriel Belingueres
Another option is to subclass the Struts 2 FilterDispatcher to perform initializations: public class YourAppDispatcher extends FilterDispatcher { public void init(FilterConfig filterConfig) throws ServletException { super.init(filterConfig); // your initialization code here... } }

Struts 2 : application-wide values initialization.

2007-09-07 Thread j alex
Hi, In Struts 1, we were having an init servlet to load the application-wide properties like dropdown values (from property files) into application context and accessing these within JSP. Is there a better way of doing this in Struts 2, and do we require an initialization servlet at all ? .

Re: Struts 2 : application-wide values initialization.

2007-09-07 Thread Chris Pratt
On 9/7/07, j alex [EMAIL PROTECTED] wrote: In Struts 1, we were having an init servlet to load the application-wide properties like dropdown values (from property files) into application context and accessing these within JSP. Is there a better way of doing this in Struts 2, and do we require

Re: Struts 2 : application-wide values initialization.

2007-09-07 Thread j alex
Hi Chris, How is the ServletContextListener suited for my purpose ? . Can you please elaborate a little more? . What i'm looking for is access to the properties files' values and flags read from DB, not able to relate how this is related to the listener. Thanks, Joseph On 9/7/07, Chris Pratt

Re: Struts 2 : application-wide values initialization.

2007-09-07 Thread Chris Pratt
On 9/7/07, j alex [EMAIL PROTECTED] wrote: How is the ServletContextListener suited for my purpose ? . Can you please elaborate a little more? . What i'm looking for is access to the properties files' values and flags read from DB, not able to relate how this is related to the listener. In