in the resource's constructor add this line: InjectorHolder.getInjector().inject(this);
then you can use that class just like a component -igor On Nov 13, 2007 2:15 PM, Enrique Rodriguez <[EMAIL PROTECTED]> wrote: > Hi, > > I have a web app where I'm using wicket-spring-annotations to inject > services into members of the Component hierarchy. This works great. > I now find myself needing access to those services from within > DynamicWebResources. IIUC, since Resources aren't part of the > Component hierarchy, they won't have SpringBean's set and, sure > enough, my services are null when I test this. > > So, what is the recommended way to access services from > DynamicWebResources? I could initialize the ApplicationContext from > within my WebApplication subclass and then acquire the needed bean and > inject it into the Resource at the time it is constructed and added to > the shared resources. This wouldn't be a huge deal, but it would mean > moving some configuration from my various web.xml's into my > WebApplication subclass, so I wanted to check if I was missing > something or if support for SpringBean's in Resources was coming or > available in more recent versions of Wicket. > > FYI, I'm using Wicket 1.2.6. If this is a new feature in newer > versions the answer could be I need to update. > > TIA, > > Enrique > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
