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!
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!
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