How to load array in JSP getAttribute

Reply

Join Date: Nov 2008
Posts: 1
Reputation: ksbigfoot is an unknown quantity at this point 
Solved Threads: 0
ksbigfoot ksbigfoot is offline Offline
Newbie Poster

How to load array in JSP getAttribute

 
0
  #1
Nov 19th, 2008
I am new at and using Struts.
I'm not sure how to do the following:
I am loading an Arraylist of TitleNames.
Each TitleName is related to a List of pictures (MyList).
MyList is a class that I created that contains all the fields needed to describe the picture.

In my code at the top of my jsp page, I have:
ArrayList tNames = (ArrayList) request.getAttribute("TitleNames");

I would like to do something like:
  1. for(int i=0;i<tNames.size();i++)
  2. {
  3. ArrayList tPics = (ArrayList) request.getAttribute("PicNames", tNames.getId());
  4. for(int j=0;j<tPics.size();i++)
  5. {
  6. out.println(tPics.getName() + "<br>");
  7. }
  8. }

But I am not sure how to do:
ArrayList tPics = (ArrayList) request.getAttribute("PicNames", tNames.getId());
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Other Threads in the JSP Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC