logic:iterate tags

Hi to everyone,

Iam new to this forum and a novice to java. I have a issue relating to using the struts frame work.

The Problem:

In the application(online test) which iam developing i need to print the questions the user has attempted, his answers and the correct answers(its basically to facilitate the test taker to analyse his result.)

Pictotrially each question and its correct answer(s) and its useranswer(s) are represented below....

arraylist(eachquestionList:(question,List:(this questions correct answers),List:(this questions user answers)))...

SEEKING SOLUTION FOR:

Printing this nested lists in a JSP using the logic:iterate tags.....

I need help and fast...

[734 byte] By [diego_armando_maradonaa] at [2007-10-2 22:02:17]
# 1
it's quite simple. http://struts.apache.org/struts-doc-1.2.7/userGuide/struts-logic.html#iterateLook at this doc, simple and efficient. All's you need =)
Kzeona at 2007-7-14 1:18:45 > top of Java-index,Java Essentials,Java Programming...
# 2
Thanks but my application has two lists within a list....in that case how do it do it?Regards
diego_armando_maradonaa at 2007-7-14 1:18:45 > top of Java-index,Java Essentials,Java Programming...
# 3
what do you mean ? One list into the other ?
Kzeona at 2007-7-14 1:18:45 > top of Java-index,Java Essentials,Java Programming...
# 4
yes i have a list containing two lists....
diego_armando_maradonaa at 2007-7-14 1:18:45 > top of Java-index,Java Essentials,Java Programming...
# 5
You should nest logic iterate tags...if you are unable to do so ...send yr code and i will send you the jsp page.....
Nistelrooya at 2007-7-14 1:18:45 > top of Java-index,Java Essentials,Java Programming...
# 6
hi thankssure but could you send me a sample code?...iam not alowed to send confidential materials...and btw what is a jspa? is it a new technology over the conventional jsp's?
diego_armando_maradonaa at 2007-7-14 1:18:45 > top of Java-index,Java Essentials,Java Programming...
# 7

> iam not alowed to send confidential materials...

I don,t think that showing 3 lines is very confidential.....especially struts code. Anyway....

It's not very hard to nest one iterate into another iterate tag. What's hard in that ? Try with a simple example on your own and who us what you've learned. if you still have problems, we will greatly help you. But not going to do it for you...

Kzeona at 2007-7-14 1:18:45 > top of Java-index,Java Essentials,Java Programming...
# 8

Hi,

I am using two arraylists, one is quesArray and the other is answerArray.

I want to print them one by one like

ques1 ans1

ques2 ans2

my form bean name is selectionCriteriaForm.

I am using the following code to do that, pls help me in writing the code.

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

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

<logic:iterate id="item2" name="selectionCriteriaForm" >

<bean:write name="item2" property="answerArray"/>

Thanx in advance.

dev_phana at 2007-7-14 1:18:45 > top of Java-index,Java Essentials,Java Programming...
# 9

Hi,

You can simply do it using html like the following :

<table>

<tr>

<td>

<%--Table of Questions-->

<table>

[b]for each question[/b]

<tr> <td>xxx</td></tr>

<tr> <td>xxx</td> </tr>

....

</table>

</td>

<td>

<%--Table of Responses-->

<table>

[b]for each response[/b]

<tr> <td>xxx</td></tr>

<tr> <td>xxx</td> </tr>

....

</table>

</td>

</tr>

</table>

HTH

java_2006a at 2007-7-14 1:18:45 > top of Java-index,Java Essentials,Java Programming...
# 10
Hi,sorry for the late reply, that problem is solved using two logic:iterate tags.Thanx for ur support
dev_phana at 2007-7-14 1:18:46 > top of Java-index,Java Essentials,Java Programming...