File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Struts and the fly likes Display an ArrayList within an ArrayList Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Head First Android this week in the Android forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Display an ArrayList within an ArrayList" Watch "Display an ArrayList within an ArrayList" New topic

Display an ArrayList within an ArrayList

Nams khonnn

Joined: Jun 12, 2006
Posts: 1
My first arraylist contains unique but different supplier categories like, (Flooring, Tiles, Carpets, etc)

My second arraylist contains details of suppliers, (name, address, email, category).

My JSP should look like this:


Supp1 Details (name, address, email).
Supp3 Details (name, address, email)

Supp2(name, address, email)
Supp4(name, address, email)

Supp5(name, address, email)

Inshort I want the first Arryalist to be displayed as header and second arraylist should be iterated and displayed under their respective category.

My JSP logic is :

<logic:iterate id="Category" name="allMySupplier_Cat">

<tr><td><bean:write name="Category" property="maincat" /></td></tr>

<logic:iterate id="Customer" name="allMySupplier_Info">

<logic:equal name="Customer" property="maincat" value=<% =Category%>

<tr><td><strong><bean:write name="Customer" property="name" /></strong></td></tr>
<tr><td><strong><bean:write name="Customer" property="email" /></strong></td></tr>

<tr><td><strong><bean:write name="Customer" property="address" /></strong></td></tr>


My above JSp throws me error saying that setValue is underfined for logic tag equal.

Any help is apprecaited.

Bear Bibeault
Author and ninkuma

Joined: Jan 10, 2002
Posts: 63052

As you seem to be having an issue with Struts tags, this has been moved to the Struts forum.

[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Brent Sterling
Ranch Hand

Joined: Feb 08, 2006
Posts: 948
I see a number of little issues with the jsp code as posted. I would expect it to look a little more like this:

Here are some things to look out for:
- no space between % and = in your value property
- logic:equal has the ending >
- there is an ending </logic:equal> tag

- Brent
I agree. Here's the link:
subject: Display an ArrayList within an ArrayList
It's not a secret anymore!