| | |
How to load array in JSP getAttribute
Please support our JSP advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
![]() |
•
•
Join Date: Nov 2008
Posts: 1
Reputation:
Solved Threads: 0
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:
But I am not sure how to do:
ArrayList tPics = (ArrayList) request.getAttribute("PicNames", tNames.getId());
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:
JSP Syntax (Toggle Plain Text)
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());
![]() |
Other Threads in the JSP Forum
- Previous Thread: JSP/Java Servlet Apache+Tomcat Sessions
- Next Thread: A simple chat
| Thread Tools | Search this Thread |
apache backbutton combobox connection database development directorystructure dynamicpagetitles eclipse frames glassfish ie8 imagetodatabse imageupload integer internet java javaee javascript jsf jsp jsppagetitles levels mvc2 mvcmodel2 network parameters passing ping printinserverinsteadofclient redirect request.getparameter response servlet servletdopost()readxml sessions software ssl state_saving_method stocks sun tomcat tutorial update video web





