Re: List manipulation

Kris Schneider <[email protected]>
Newsgroups gmane.comp.jakarta.taglibs.user
Message-ID <[email protected]>
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:[email protected]>
D.O.Tech       <http://www.dotech.com/>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.