• 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

Problem with 2 collection

 
Ranch Hand
Posts: 464
Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi All,

I have 2 collections.
First collection is a collection of Schedule with following attributes.
Schedule = {schedule_id,job_id,client_id}
Another collection is a collection of Job with the following attributes.
Job = {job_id,job_name}

Now in the schedule list page i want to display the job_name for the corresponding job_id of the Schedule in the first collection

that is my list page is as follows

ScheduleName JobName
<name> <name>

How do i accomplish this using struts tag-libs in my JSP.

Thanks
Venkatesh S
 
Ranch Hand
Posts: 181
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Ideally, you should populate your bean in your action to contain the necessary information without having to cross reference the two lists in the jsp. For example, your bean can be a collection of ScheduleJobClient POJO DTOs that looks like this:


That way you can iterate over the ScheduleJobClient list in your bean and display the job name for each schedule.
 
S Venkatesh
Ranch Hand
Posts: 464
Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thank you very much. I did the same Its working perfectly now.
 
reply
    Bookmark Topic Watch Topic
  • New Topic