Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Display an ArrayList within an ArrayList

 
Nams khonnn
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 64701
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
As you seem to be having an issue with Struts tags, this has been moved to the Struts forum.
 
Brent Sterling
Ranch Hand
Posts: 948
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic