Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to load array in JSP getAttribute

Status
Not open for further replies.

ksbigfoot

Programmer
Apr 15, 2002
856
CA
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:
Code:
for(int i=0;i<tNames.size();i++)
{
  ArrayList tPics = (ArrayList) request.getAttribute("PicNames", tNames.getId());
  for(int j=0;j<tPics.size();i++)
  {
    out.println(tPics.getName() + "<br>");
  }
}

But I am not sure how to do:
ArrayList tPics = (ArrayList) request.getAttribute("PicNames", tNames.getId());
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top