This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Struts and the fly likes Problem using nested logic:iterate tags Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Problem using nested logic:iterate tags" Watch "Problem using nested logic:iterate tags" New topic
Author

Problem using nested logic:iterate tags

Jose Tharayil Raphael
Greenhorn

Joined: Aug 11, 2003
Posts: 4
Hi,

I am having a problem with struts nested logic:iterate tags

Below is the code:

<logic:notEmpty name="aimEditActivityForm" property="fundingOrganizations">
<logic:iterate name="aimEditActivityForm" property="fundingOrganizations"
id="fundingOrganization"
type="org.digijava.module.aim.helper.FundingOrganization">
<logic :present name="fundingOrganization">
<logic:iterate name="fundingOrganization" property="fundings"
id="funding"
type="org.digijava.module.aim.helper.Funding">
<logic :present name="funding">
<logic:iterate name="funding" property="fundingDetails"
id="fundingDetail"
type="org.digijava.module.aim.helper.FundingDetail">
<logic :p resent name="fundingDetail">
<tr bgcolor="#006699" class="textalb">
<td><b><font color="white"></font></b></td>
</tr>
</logic :present>
</logic:iterate>
</logic :present>
</logic:iterate>
</logic :present>
</logic:iterate>
</logic:notEmpty>

The jsp page is not compiling below is the error :

line: 112 in the jsp file: /repository/aim/view/addFunding.jsp Generated servlet error: G:\jboss\server\default\work\jboss.web\localhost\digijava\org\apache\jsp\repository\aim\view\addFunding_jsp.java:343: incompatible types found : java.lang.String required: org.digijava.module.aim.helper.FundingDetail _jspx_fundingDetail_2 = fundingDetail; ^ An error occurred at line: 112 in the jsp file: /repository/aim/view/addFunding.jsp Generated servlet error: G:\jboss\server\default\work\jboss.web\localhost\digijava\org\apache\jsp\repository\aim\view\addFunding_jsp.java:349: incompatible types found : org.digijava.module.aim.helper.FundingDetail required: java.lang.String fundingDetail = (org.digijava.module.aim.helper.FundingDetail) _jspx_page_context.findAttribute("fundingDetail"); ^ An error occurred at line: 112 in the jsp file: /repository/aim/view/addFunding.jsp Generated servlet error: G:\jboss\server\default\work\jboss.web\localhost\digijava\org\apache\jsp\repository\aim\view\addFunding_jsp.java:358: incompatible types found : org.digijava.module.aim.helper.FundingDetail required: java.lang.String fundingDetail = (org.digijava.module.aim.helper.FundingDetail) _jspx_page_context.findAttribute("fundingDetail"); ^ An error occurred at line: 112 in the jsp file: /repository/aim/view/addFunding.jsp Generated servlet error: G:\jboss\server\default\work\jboss.web\localhost\digijava\org\apache\jsp\repository\aim\view\addFunding_jsp.java:362: incompatible types found : org.digijava.module.aim.helper.FundingDetail required: java.lang.String fundingDetail = _jspx_fundingDetail_2; ^ 4 errors '

The fundings and fundingDetails collection are null.I tried checking with
logic:notEmpty tags. But it's giving a compile error so does not reach there.

I am stumped.

Thanks in advance.
[ January 09, 2005: Message edited by: Jose Tharayil Raphael ]
Jose Tharayil Raphael
Greenhorn

Joined: Aug 11, 2003
Posts: 4
Hi,

Found out the problem.I am using Struts 1.1 . The struts logic:iterate
tags doesn't seem to support nested logic:iterate tags beyond 2 levels.
I used JSTL and it worked fine.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Problem using nested logic:iterate tags
 
Similar Threads
tags within tags?
Unable to compile jsp's
help! Where shall i put tld files in jboss
cewolf problem in jboss
Jsp is compiled but getting empty blank page