permaculture playing cards*
The moose likes Struts and the fly likes Displaying different entity data in a vector on a page Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Displaying different entity data in a vector on a page" Watch "Displaying different entity data in a vector on a page" New topic
Author

Displaying different entity data in a vector on a page

AnilPrakash Raju
Ranch Hand

Joined: Jul 26, 2004
Posts: 137
Hi,
I was wondering if the following can be done:

I got 2 entities in a bean and a vector of beans and i need to display some fields frm both entities.

eg.

beanSummary1.add(entity1)
beanSummary1.add(entity2)

beanSummary2.add(entity1)
beanSummary2.add(entity2)

beanSummary3.add(entity1)
beanSummary3.add(entity2)

beanSummaryVec.add(beanSummary1)
beanSummaryVec.add(beanSummary2)
beanSummaryVec.add(beanSummary3)


So in my jsp page i iterate over each beanSummary but i need to display a couple of fields from each entites.

I started doing the following:
<logic:iterate id="beanSummary" name="beanSummaryVec">
<tr>
<td><bean:write name="beanSummary" property="entity1.Field1"/> </td>
<td><bean:write name="beanSummary" property="entity1.Field2"/> </td>
<td><bean:write name="beanSummary" property="entity2.Field1"/> </td>
<td><bean:write name="beanSummary" property="entity2.Field2"/> </td>
</tr>
</logic:iterate>

and it wrong. But can it be done without making the beanSummary into a flat entity.

I was trying to use nested but could not get it working.

Thanks

Anil
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Displaying different entity data in a vector on a page