struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andy Law <>
Subject Re: How to get the value of Constants defined in struts.xml
Date Mon, 25 Oct 2010 14:08:21 GMT

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 my configuration file (referencing in my
<action><result></result></action> tags, @Injecting into my action
then I would be much happier (well, a *bit* happier).

Of course, there would still be the pervasive smell over trying to get the
values into the tests.... :o{

Dave Newton-6 wrote:
> 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

View this message in context:
Sent from the Struts - User mailing list archive at

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message