wood burning stoves 2.0*
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 The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Display an ArrayList within an ArrayList" Watch "Display an ArrayList within an ArrayList" New topic
Author

Display an ArrayList within an ArrayList

Nams khonnn
Greenhorn

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:

Flooring:

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

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

Carpet
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>

</logic:iterate>

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

Any help is apprecaited.

Thanks
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61092
    
  66

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
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Display an ArrayList within an ArrayList