Re: xwork and DI

2008-04-22 Thread Brian Pontarelli
You can definitely inject from any of the XWork files, struts-default.properties, struts.properties, struts.xml, struts-default.xml, struts-plugin.xml. These are all configured in the Dispatcher when the Container is created (I think). -bp Musachy Barroso wrote: I tried that, I think the p

Re: xwork and DI

2008-04-21 Thread Musachy Barroso
I tried that, I think the problem is where to define the constant. I used default.properties, where the others are defined, but the container complains that it cannot satisfy the dependency. Of all examples I found on xwork, only one references the bean to be injected by name (which might not be wo

Re: xwork and DI

2008-04-21 Thread Jeromy Evans
Musachy Barroso wrote: If I want to add a constant that can be injected in one of xwork classes (like "devMode" for example), what do I need to do? Just adding @Inject and defining the constant in default.properties in core doesn't work. I don't know much about this whole guice black magic thing

Re: xwork and DI

2008-04-21 Thread Wes Wannemacher
Not the object you are injecting, but the object that is being injected... Like here - http://struts.apache.org/2.x/struts2-core/apidocs/com/opensymphony/xwork2/inject/Container.html Foo has dependencies injected, but if you instantiate it as Foo foo = new Foo(); Then you won't get anything

Re: xwork and DI

2008-04-21 Thread Musachy Barroso
It is just an string, like "devMode". musachy On Mon, Apr 21, 2008 at 8:00 PM, Wes Wannemacher <[EMAIL PROTECTED]> wrote: > Musachy, > > Is your object (injectee) instantiated by the container? I think there > is some work to do after instantiating so that the dependencies can be > injected. >

Re: xwork and DI

2008-04-21 Thread Wes Wannemacher
Musachy, Is your object (injectee) instantiated by the container? I think there is some work to do after instantiating so that the dependencies can be injected. -Wes On Mon, 2008-04-21 at 14:37 -0400, Musachy Barroso wrote: > If I want to add a constant that can be injected in one of xwork > c

xwork and DI

2008-04-21 Thread Musachy Barroso
If I want to add a constant that can be injected in one of xwork classes (like "devMode" for example), what do I need to do? Just adding @Inject and defining the constant in default.properties in core doesn't work. I don't know much about this whole guice black magic thing :) musachy -- "Hey you