Re: How to get the value of Constants defined in struts.xml

2010-10-25 Thread Andy Law
Heading off at a slight tangent, is it possible to use the constant values in action configurations within the struts XML? I have long thought it a code smell that I have magic strings in my XML configuration that get repeated in my code. If I could handle those by reference to a single point in

Re: How to get the value of Constants defined in struts.xml

2010-10-25 Thread Dave Newton
Simplicity: it's just an @Inject. On Mon, Oct 25, 2010 at 2:55 AM, SudhirJava wrote: > > Struts Constants. > I can define in web.xml and get the value in Action class too. > Then what is the use of Struts Constants? > > > ~SK > > > Maurizio Cucchiara wrote: >> >> I'm not sure what you mean. >> Wh

Re: How to get the value of Constants defined in struts.xml

2010-10-24 Thread SudhirJava
Struts Constants. I can define in web.xml and get the value in Action class too. Then what is the use of Struts Constants? ~SK Maurizio Cucchiara wrote: > > I'm not sure what you mean. > What's the benefit of inversion of control? or struts constant? > > 2010/10/25 SudhirJava : >> >> Can any

Re: How to get the value of Constants defined in struts.xml

2010-10-24 Thread Maurizio Cucchiara
I'm not sure what you mean. What's the benefit of inversion of control? or struts constant? 2010/10/25 SudhirJava : > > Can anybody please tell me > What is the Benefit of this ? > I can define it in web.xml can retrieve it. > > What is the main purpose of this?? > > > ~SK > > > SudhirJava wrote:

Re: How to get the value of Constants defined in struts.xml

2010-10-24 Thread SudhirJava
Can anybody please tell me What is the Benefit of this ? I can define it in web.xml can retrieve it. What is the main purpose of this?? ~SK SudhirJava wrote: > > Thanks. > That works... > > I think it should be value instead of name > i.e. > @Inject(value="myConstant") > instead of > @Inje

Re: How to get the value of Constants defined in struts.xml

2010-10-22 Thread SudhirJava
Thanks. That works... I think it should be value instead of name i.e. @Inject(value="myConstant") instead of @Inject(name="myConstant") ~SK rahulmohan wrote: > > Just put an @Inject(name="MYCONSTANTVARIABLE") annotation on the setter in > action class. > > - RM > > > > From: > SudhirJa

Re: How to get the value of Constants defined in struts.xml

2010-10-21 Thread Rahul Mohan
Just put an @Inject(name="MYCONSTANTVARIABLE") annotation on the setter in action class. - RM From: SudhirJava To: user@struts.apache.org Date: 21-10-2010 17:58 Subject: How to get the value of Constants defined in struts.xml I am sorry, if this thread is repeated. Please tell tell me h

Re: How to get the value of Constants defined in struts.xml

2010-10-21 Thread Dave Newton
Get it where? Normally you'd just use the @Inject annotation, IIRC. Dave On Thu, Oct 21, 2010 at 8:27 AM, SudhirJava wrote: > > I am sorry, if this thread is repeated. > > Please tell tell me how get the value of Constants defined in struts.xml. > Is it possible to get the value of "MYCONSTANTVA