Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

unable to iterate ArrayList which is in request scope. ArrayList contains bean

 
nitin jha
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
have ArrayList in request which contais bean object I am not able to Itrate this bean in jsp

What is the problem in this code???

ArrayList approverList = activateApproverDAO.getApproverRecord();
System.out.println("got List form PRM Database...");
Iterator itr = approverList.iterator();
while (itr.hasNext()) {
ActivateApproverBeanVO activateApproverBeanVO = (ActivateApproverBeanVO)itr.next();
System.out.println("User Id....."+ activateApproverBeanVO.getUserId());
System.out.println("Approver Type...."+activateApproverBeanVO.getApproverType());
System.out.println("Status....."+activateApproverBeanVO.getStatus());
}

request.setAttribute("listApprover", approverList);


**************************

<logic:iterate id="appId" name="listApprover" scope="request">
<bean:define id="approverRecord" name="appId"
type="com.techm.sdp.prm.vo.ActivateApproverBeanVO" />
<tr>
<logic:iterate id="approverDetail" name="approverRecord">
<td class="tdspace" align="left">
<bean:write name="approverDetail" property="userId" />
</td>
<td class="tdspace" align="left">
<bean:write name="approverDetail" property="approverType" />
</td>
<td class="tdspace" align="right">
<bean:write name="approverDetail" property="status" />
</td>
</logic:iterate>
</tr>
</logic:iterate>
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please UseCodeTags when posting code or configuration. Unformatted code and configuration is very difficult to read. You can edit your post to include them by using the button.
 
Tom Rispoli
Ranch Hand
Posts: 349
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This tag looks suspect to me:

<logic:iterate id="approverDetail" name="approverRecord">

From your code it appears that the com.techm.sdp.prm.vo.ActivateApproverBeanVO isn't a list, so you don't need to iterate over it. You might want to try taking out the inner iterate tag and setting the name attribute of your bean:write tags to approverRecord instead of approverDetail.

Hope that helps.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic