First, ensure that the object that Struts will be injecting to is created by Struts. Then, you can do:
@Inject(StrutsConstants.SOME_CONSTANT_HERE) public void setSomeConstant(String val) {...} For example, Actions, Interceptors, and Result objects are generally processed for injections by Struts, so you could put the setter in one of those. Don On 8/17/07, Joe Lam <[EMAIL PROTECTED]> wrote: > > In my class, I want to read a constant in struts.xml. > I see some examples using @inject , somehow I cant make it work. > > May someone help me? just wanna to get those constants in struts.xml > (don't want to use java properties file this time. I think it is easier to > maintain in struts.xml) > > Thanks > > Joe > > -- > View this message in context: > http://www.nabble.com/-S2--how-to-get-the-constants-in-struts.xml-programmatically--tf4285007.html#a12197579 > Sent from the Struts - User mailing list archive at Nabble.com. > > > --------------------------------------------------------------------- > 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]