• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Liutauras Vilda
  • Paul Clapham
  • paul wheaton
Sheriffs:
  • Tim Cooke
  • Devaka Cooray
  • Rob Spoor
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Tim Moores
  • Carey Brown
  • Mikalai Zaikin
Bartenders:

bean:define not working in logic:iterate

 
Ranch Hand
Posts: 148
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hey Guys,

I'm trying to iterate through contents of a list that has a sub list inside it. I noticed that my JSP only displays the first list and contents of it's sub list. I'm using <bean efine> between the parent list and it's child list.

It seems like when the JSP executes the <bean efine> the first time in the loop it's fine. But when it comes across the <bean efine> the second time it does not execute it.

Do anyone know why?!?! ...and how can I get around this?

Here's my code:
<!-- GET Sub Category List -->
<logic:iterate id="subCategoryCbo" name="subCatList">

<bean efine id="subCatName" property="serviceSubCategoryName" name="subCategoryCbo" />
<bean efine id="subCatCode" property="serviceSubCategoryCode" name="subCategoryCbo" />
<bean efine id="subCatId" property="serviceSubCategoryId" name="subCategoryCbo" type="java.lang.Integer" />
<bean efine id="serviceMapList" property="serviceMap" name="serviceCategoryDto" />

<p><%=subCatName.toString().toUpperCase() %></p>
<table>
<!-- GET Service Map List -->
<logic:iterate id="serviceMap" name="serviceMapList">
<%
String ID = subCatId.toString();
%>
<logic:equal property="key" name="serviceMap" value="<%=ID%>">
KEY: <bean:write property="key" name="serviceMap" />
ID: <bean:write property="serviceSubCategoryId" name="subCategoryCbo" />
<bean efine id="serviceList" name="serviceMap" property="value"/>
<!-- GET Services -->
<% int index = 0; %>
<logic resent name="serviceList">
<logic:iterate id="serviceCbo" name="serviceList">
<% index++; if(index == 1) { out.print("<TR>"); } %>
<TD>
<html:multibox property="selectedHairService">
<bean:write property="serviceCode" name="serviceCbo" />
</html:multibox>
<bean:write property="serviceName" name="serviceCbo" />
</TD>
<%if(index%3 == 0) { out.print("</TR>"); index = 0;} %>
</logic:iterate>
</logic resent>
</logic:equal>
</logic:iterate>
</table>
<p> </p>
<p> </p>
</logic:iterate>

Pls...HeLP!!!
 
Nina Anderson
Ranch Hand
Posts: 148
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
does anyone know what the alternative to using <bean efine> in an iteration <logic:iterate> is?
 
Ranch Hand
Posts: 185
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The substitute can be <c:set var>, which is from jstl. I would suggest that you use the combination of struts tags and jstl tags, or struts-el tags.
 
Hey cool! They got a blimp! But I have a tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic