Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

How do you create an array using JSTL / EL?

843838Jul 7 2006 — edited Jun 12 2008
Is it possible to create an array using EL in JSTL tags? For example, I would like to create something like this, only using JSTL and EL:
String[] myArray = {"one", "two", "three"};
I have read through the specification for both 1.0 and 1.1, and I could not find anything that mentioned it. Right now, I have to be able to do something using 1.0, but if this is only possible using 1.1, then I am still interested in how you do it. We should be upgrading our container to one that can use 1.1 sometime later this year.

I have tried the following, without success:
<c:set var="myArray" value="'one', 'two', 'three'" />
<c:set var="myArray" value="['one', 'two', 'three']" />
<c:set var="myArray" value="{'one', 'two', 'three'}" />
If anyone knows if this can be done and how to do it, I would greatly appreciate your ideas.

Thanks in advance.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jul 10 2008
Added on Jul 7 2006
14 comments
63,965 views