struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Karr, David" <david.k...@wamu.net>
Subject RE: using Constants from JSTL .....
Date Thu, 08 Jul 2004 14:56:47 GMT
> -----Original Message-----
> From: Bryan Hunt [mailto:admin@revoltingdigits.com] 
> 
> But for some reason ( my stupidity and the time of the evening ) I 
> cannot get this to work.
> snip=
> <c:set var="emailNotifications" 
> value="${scope['Constants.EMAIL_NOTIFICATIONS']"></c:set>
> <c:out value="${emailNotifications.priceRangeStart}"/>
> =snip
> 
> or like this
> 
> snip=
> <c:set var="emailNotifications" 
> value="${scope[${Constants.EMAIL_NOTIFICATIONS}]"></c:set>
> <c:out value="${emailNotifications.priceRangeStart}"/>
> =snip

You should read the JSTL specification.  That would have made clear that
the latter has no chance of working, and it might have made clear what
the former is doing.

Try the following:

<c:set var="emailNotifications" 
  value="${applicationScope[Constants.EMAIL_NOTIFICATIONS]"></c:set>
<c:out value="${emailNotifications.priceRangeStart}"/>

That has a better chance of working, assuming the correct value is in
the "EMAIL_NOTIFICATIONS" property of the "Constants" object in
application scope.

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Mime
View raw message