setting a value of an indexed property using JSTL

Hi,

I was wondering how I can set a value of an indexed property from inside a jsp-page.

Suppose I have a bean instance called myBean which has 3 properties:

String name;

int number;

String[] array;

In my .jsp file I can set the name and number using:

<jsp:useBean id="myBean" scope="session" class="org.me.hello.NameHandler" />

<c:set target="${myBean}" property="name" value="${param.name}" />

<c:set target="${myBean}" property="number" value="${param.number}"/>

But how can I store the 'name' at the 'number' position of my array? Is this somehow supported? I tried numerous things, but to no avail.

Thanks!

vAak

[976 byte] By [vAaka] at [2007-11-27 6:02:59]
# 1

Did the following work:

<c:set target="${myBean}" property="array[0]" value="I am in the first array position assuming the array has been initialized to have a length greater than 0!"/>

Cheers,

Laird

ljnelsona at 2007-7-12 16:45:06 > top of Java-index,Desktop,Developing for the Desktop...
# 2

Nope, tried that already.

I'm using the following scriptlet for now:

<% myBean.setArray(myBean.getNumber(), myBean.getName()); %>

While it is just a little stupid application to gettting to know JSP etc, I think it's not that nice if I can use JSTL for most of the time but need to use a scriptlet for this...

Thanks anyway!

vAaka at 2007-7-12 16:45:06 > top of Java-index,Desktop,Developing for the Desktop...