And what if you are using a different ObjectFactory... such as Spring?

- Patrick.

-----Original Message-----
From: Don Brown [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, August 22, 2007 5:26 AM
To: Struts Users Mailing List
Subject: Re: [S2] how to get the constants in struts.xml
programmatically?

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-prog
> rammatically--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]
>
>



***********************************************************************
Bear Stearns is not responsible for any recommendation, solicitation,
offer or agreement or any information about any transaction, customer
account or account activity contained in this communication.
***********************************************************************

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to