• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Displaying different entity data in a vector on a page

 
Ranch Hand
Posts: 137
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
No. No. No. No. Changed my mind. Wanna come down. To see this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic