It's a little more verbose, but you might also consider having a servlet
context Hashmap attribute, called "constants", perhaps, and your app
setup would put all your constants into the map, so you would reference
it like this:

  '${constants["MY_KEY"]}'

Actually, if you assume that all of your constant names have no spaces
in them (I guess that's reasonable :) ), you could also do:

  "${constants.MY_KEY}"

> -----Original Message-----
> From: Craig R. McClanahan [mailto:[EMAIL PROTECTED]]
> 
> On Wed, 20 Nov 2002, David Graham wrote:
> 
> > Date: Wed, 20 Nov 2002 15:02:22 -0700
> > From: David Graham <[EMAIL PROTECTED]>
> > Reply-To: Struts Users Mailing List <[EMAIL PROTECTED]>
> > To: [EMAIL PROTECTED]
> > Subject: Re: JSTL Question (EL vs. RT + Struts)
> >
> > But what is the EL expression to get a constant like 
> Constants.MY_KEY?
> >
> 
> What I would do is have my app setup code save the value of
> Constants.MY_KEY as a servlet context attribute such as 
> "MY_KEY".  Then,
> the expression to access it would be the obvious one:  "${MY_KEY}".
> 
> > David
> >
> 
> Craig
> 
> 
> --
> To unsubscribe, e-mail:   
<mailto:[EMAIL PROTECTED]>
For additional commands, e-mail:
<mailto:[EMAIL PROTECTED]>

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

Reply via email to