Re: Expression Language question

2003-05-28 Thread Kris Schneider
Doing it all in a JSP:







Outputs "xyzzy". If you're trying to use a scripting variable with JSTL, it
won't work (unless you're using the RT versions of the tags). The EL versions of
the tags only deal with scoped attributes. So, it would work if you did:

request.setAttribute("indexStr", "bar");

Quoting Matthew Van Horn <[EMAIL PROTECTED]>:

> 
> How do you write an index variable in an expression, where the index is 
> also variable.
> i.e.
> Given:
> HashMap foo = new HashMap();
> foo.put("bar", "xyzzy");
> foo.put("baz", "plugh");
> 
> String indexStr = "bar";
> 
> 
> this doesn't seem to work.
> 
> I think it is doing foo.get("indexStr") instead of foo.get("bar");
> 
> 
> How can I do this the right way?
> 
> Thanks,
> Matt


-- 
Kris Schneider 
D.O.Tech   

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



Expression Language question

2003-05-27 Thread Matthew Van Horn
How do you write an index variable in an expression, where the index is 
also variable.
i.e.
Given:
HashMap foo = new HashMap();
foo.put("bar", "xyzzy");
foo.put("baz", "plugh");

String indexStr = "bar";

this doesn't seem to work.

I think it is doing foo.get("indexStr") instead of foo.get("bar");
How can I do this the right way?

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