Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Problem with 2 collection

 
S Venkatesh
Ranch Hand
Posts: 464
Ubuntu
  • Mark post as helpful
  • send pies
  • 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
 
Dom Lassy
Ranch Hand
Posts: 181
  • Mark post as helpful
  • send pies
  • 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
  • Quote
  • Report post to moderator
Thank you very much. I did the same Its working perfectly now.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic