Urgent - Grab multi-dimention vector values

Hi,

I have a vector, each object inside this vector is comprised of another 3 vectors. How can I loop throught this multi-dimention vectors and display out their values one by one?

This is an urgent problem need to be solved. Thanks so much for anyone who can help me figure it out!

[302 byte] By [yfcsg@yahoo.com.sga] at [2007-10-2 16:56:19]
# 1
how long have you been doing java.Just use two loops one for the main vector and the other inner loop for inner vectors.
masoodmjana at 2007-7-13 18:09:00 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 2
Thanks for your reply. Yes, I am a newbie to Java. I think scriptlet can perform it, but whether I can make use of taglib to achieve it? Would you please provide an example?Thanks again.
yfcsg@yahoo.com.sga at 2007-7-13 18:09:00 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 3
>but whether I can make use of taglib to achieve it?Google for jstl and c:forEach tag. Be warned that setting it up or any other third party taglib in your web application is not a trivial task for somebody who's just begun ramping up on the technology.ram.
Madathil_Prasada at 2007-7-13 18:09:00 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 4

My code is as following:

form action:

Vector output = db.selectTransactionByConditionDate(conditions,fromtimestamp,totimestamp,sform.getCondition());

request.setAttribute("output", output);

jsp:

<logic:iterate id="item" name="output">

<bean:write name="item" property="orderid" />

<bean:write name="item" property="productname" />

<bean:write name="item" property="type" />

</logic:iterate>

Can anybody give me a suggestion how to modify this piece of code to read this nested vector?

As what I have described earlier, each element of the current output is comprised of another 3 vectors: order, orderitem, orderresponse.

Thanks so much for your advice!

yfcsg@yahoo.com.sga at 2007-7-13 18:09:00 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 5

I have found the solution for this question, and posted it here for those who might encounter the same problem with me:

To get the first element's first vector's orderid element:

<c:out value='${output[0][0].orderid}' />

, assuming the first vector is a bean of order

to get the first element's second vector's productname element:

<c:out value='${output[0][1].productname}' />

, assuming the second vecotor is a bean of product

yfcsg@yahoo.com.sga at 2007-7-13 18:09:00 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...