tomcat-taglibs-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Taavi Tiirik" <>
Subject Re: expression that contains expression
Date Fri, 04 Jul 2003 07:44:20 GMT

Thanks, David

${pageScope[variableName]} is indeed a solution that works. Thanks
for pointing it out. It does not work though if variable contains a dot in
its name as they do in my case.

There is this article providing one solution at

It just gets too tricky. Some sort of custom tag would help but I do not
want custom tags here at this point.

Does jsp 2.0 expression language address this somehow?
${name${index}} could be quite readable and understandable I think :)

with best wishes,

From: "David M. Karr" <>
> This isn't as clean as it could be, but now that you have a variable that
> contains the name of the variable, if you know which scope the variable is
> you can then reference that scope as a HashMap, using the variable value
as the
> key.  If you don't know the scope it is in, well, we don't yet have a
> HashMap that is a union of all of the scopes, so you could conceivable
build it
> from scratch.
> For instance, the scoped HashMaps are "pageScope", "requestScope",
> "sessionScope", and "applicationScope".  The reference of
> "${pageScope[variableName]}" would reference your computed variable name,
> you knew it was in page scope.

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

View raw message