JSTL set tag

[nobr]Good afternoon,

How do I implement this correctly?I get the following error:

javax.servlet.jsp.el.ELException: Unable to find a value for "0" in object of class "java.lang.String" using operator "[]"

Any suggestions are appreciated. Thanks.

<body>

<c:set var="item" scope="page">

cat,dog

</c:set>

cat: ${item[0]}<br>

dog: ${item[1]}

</body>

[/nobr]

[614 byte] By [Greg439a] at [2007-11-26 15:00:08]
# 1

From your code it looks like you are trying to create a collection with 2 values in it. But the code you are using:

<c:set var="item" scope="page">

cat,dog

</c:set>

will not work, because whatever is between the opening c:set and closing c:set is considered as one string, and not an array of strings.

appy77a at 2007-7-8 8:48:57 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...