tomcat-taglibs-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Kris Schneider <k...@dotech.com>
Subject Re: List manipulation
Date Mon, 18 Sep 2006 13:07:39 GMT
Mohsen Saboorian wrote:
> I wonder if there is any support for List manipulation in JSTL.
> I want to initialize an ArrayList with something like <c:set
> var="${myList[2]}" value="123445" />, but this gives me error (suppose that
> myList is already put into pageContext).

Unfortunately, that sort of thing isn't possible with JSTL. If you look at 
the definition of the <c:set> tag, you'll see that the "var" attribute 
cannot use a request-time value. In other words, it can only use a string 
literal. Probably the best thing to do would be to create an EL function 
for this sort of thing. See the JSP 2.0 spec section "JSP.2.6 Functions".

> Thanks.

-- 
Kris Schneider <mailto:kris@dotech.com>
D.O.Tech       <http://www.dotech.com/>

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


Mime
View raw message