I believe you can do (with reportID a variable containing the key)
<:set var="laborReport" value='${mapOfLaborReports[reportID]}'/>

which is very different from (with "reportID" as the key)
<:set var="laborReport" value='${mapOfLaborReports["reportID"]}'/>

so to use 3 as a key
<c:set var="laborReport" value='${mapOfLaborReports["3"]}'/>

nick
On 16 Jul 2003, Rick Reumann wrote:

> There is probably a real easy answer for these two questions, but I
> searching the archives for a while hasn't helped...
>
> 1) I have beans in a map that are stored with integers for the keys.
>
> For testing I can retrive the bean out fine with the key of "test" like:
>
> <c:set var="laborReport" value="${mapOfLaborReports.test}"/>
>
> But if I try this with...
>
> <c:set var="laborReport" value="${mapOfLaborReports.3}"/>
>
> I get a parsing error:
>
> 4: tag = 'set' / attribute = 'value': An error occurred while parsing
> custom action attribute "value" with value "${mapOfLaborReports.3}":
> Encountered ".3", expected one of ["}", ".", ">", "gt", "<", "lt", "==",
> "eq", "<=", "le", ">=", "ge", "!=", "ne", "[", "+", "-", "*", "/",
> "div", "%", "mod", "and", "&&", "or", "||", ":", "("]
>
>
>
> 2) Also, is there a way that I can some how nest my expressions? In
> other words say "test" is the value of a parameter with the name
> "reportID" in scope. Now in the first example I'd like to be able to do
> something like...
>
> <:set var="laborReport" value="${mapOfLaborReports.${reportID}}"/>
>
> (Tied into the first question reportID is an Integer but if need be I
> can make sure it's a String representation of the Integer).
>
>
> Thanks for any help.
>
> --
> Rick
>
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


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

Reply via email to