[EMAIL PROTECTED] wrote:
Hmm... hadn't thought of trying that, but the library seems to be trying to
pull an attribute tied to the key 'requestScope[expression]' from the
request scope for rendering - as opposed to rendering the expression found
at requestScope['expression'] :-)

There's no support in the EL for evaluating a variable value as a complete expression, only as "names". So, instead of keeping the expression "business.name" in a scoped variable, you need to split it up into parts, e.g., one variable named "bean" holding the value "business" and another variable named "prop" holding the value "name".

If both these variables are in the request scope, and "business" is a
bean or a Map with a "name" property, try this:

${requestScope[bean][requestScope[prop]]}

Hans

-----Original Message-----
From: Karr, David [mailto:[EMAIL PROTECTED] Sent: Wednesday, October 29, 2003 4:29 PM
To: Tag Libraries Users List
Subject: RE: Storing JSTL/EL statements?



Ok, this is getting weird. How about: "${requestScope[requestScope[expression]]}"?



-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] Sent: Wednesday, October 29, 2003 12:50 PM
To: [EMAIL PROTECTED]
Subject: RE: Storing JSTL/EL statements?



I tried something similar to this a while ago and instead of
printing the
business name out, it instead printed the expression out (ie,
"business.name" was sent to the browser - not the actual business name).
Any special parameters I need to set?



-----Original Message-----
From: Karr, David [mailto:[EMAIL PROTECTED]
Sent: Wednesday, October 29, 2003 3:39 PM
To: Tag Libraries Users List
Subject: RE: Storing JSTL/EL statements?


You might get mileage out of something like this: "${requestScope[expression]}".


-----Original Message-----
From: [EMAIL PROTECTED]

i have, what is hopefully, a very brief question. does anyone know of a way to evaluate an EL statement that is cached in
request/session/etc scope?
say you have "business.name" expression stored in request scope (tied to
"expression") alongside a "business" object. i'd essentially like to do
something like this:


<c:out value="${${expression}}" />

which would perform 2 evaluations giving - in theory:

<c:out value="${business.name}" />
Business Foobar

(assuming Business Foobar is the "name" attribute of

hte business


attribute). this one's killin' me! :-)
--
Hans Bergsten                                <[EMAIL PROTECTED]>
Gefion Software                       <http://www.gefionsoftware.com/>
Author of O'Reilly's "JavaServer Pages", covering JSP 1.2 and JSTL 1.0
Details at                                    <http://TheJSPBook.com/>


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



Reply via email to