chicago1985 0 Light Poster

--------------------------------------------------------------------------------

I have this test working where it takes data from a Java class and shows it in a JSP:

String targetItems = "test"

List pageItems = New ArrayList;

for(int i = 0;i < calculatedResults + 10;i++)
{
    pageItems.add(targetItems + " " + i)
}
request.setAttribute(pageItems, "pageItems");

I would like to stop using test and put real data in using
an ArrayList but my attempt outputs a huge array of info for each record:

ArrayList<TargetBean> targetItems = New ArrayList<TargetBean> (TargetListing.getList()); 

List pageItems = New ArrayList;

for(int i = 0;i < calculatedResults + 10;i++)
{
    pageItems.add(targetItems + " " + i)
}
request.setAttribute(pageItems, "pageItems");

Please advise.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.