Erik, That's exactly how it should work - the beauty of IoC! :)
Do you have the IoC filters / listeners installed? You need these to be plugged in for the IoC system to work. http://wiki.opensymphony.com/space/WebWork+2+Components But what you're doing is how it should be done! M On 2/7/03 12:32 PM, "Erik Hatcher" ([EMAIL PROTECTED]) penned the words: > On Tuesday, July 1, 2003, at 04:52 PM, Jason Carreira wrote: >> Check out ServletActionContext.getServletContext(). This should let you >> do what you want to do (at the expense of not being able to use your >> Action outside a Servlet container, but you're used to Struts, so we >> forgive you :-)) > > I have this in WEB-INF/classes/components.xml: > <components> > <component> > <scope>application</scope> > <class>org.example.antbook.webwork.AppConfig</class> > <enabler>org.example.antbook.webwork.AppConfigAware</enabler> > </component> > </components> > > I'm still working my way through the source code to see how this stuff > works, but it'd be nice if something like this worked. It didn't work > for me with my action class implementing AppConfigAware (like the > sample CounterAware) - the setter is never called. Help me out by > pointing me to places in the code where this config stuff is used and > accessed so I can learn it, thanks! > > This isn't something critical, I'm just converting my demo app that has > some hacked state in application scope which really should be > refactored to another mechanism. I could implement > HttpServletRequestAware and enable the ServletConfigInterceptor, it > seems. I guess either what Jason said, or this, would work, but I'm > aiming for something more decoupled. > > In our production apps we do cache our code table lookups (states, > countries, etc) in applications scope, though, so we'd certainly need > to get at this easily in WW2 within JSP pages at least (but not really > needed in actions, I don't think). > > Erik > > > > ------------------------------------------------------- > This SF.Net email sponsored by: Free pre-built ASP.NET sites including > Data Reports, E-commerce, Portals, and Forums are available now. > Download today and enter to win an XBOX or Visual Studio .NET. > http://aspnet.click-url.com/go/psa00100006ave/direct;at.asp_061203_01/01 > _______________________________________________ > Opensymphony-webwork mailing list > [EMAIL PROTECTED] > https://lists.sourceforge.net/lists/listinfo/opensymphony-webwork ------------------------------------------------------- This SF.Net email sponsored by: Free pre-built ASP.NET sites including Data Reports, E-commerce, Portals, and Forums are available now. Download today and enter to win an XBOX or Visual Studio .NET. http://aspnet.click-url.com/go/psa00100006ave/direct;at.asp_061203_01/01 _______________________________________________ Opensymphony-webwork mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/opensymphony-webwork