You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by James Krygowski <ja...@shaws.com> on 2002/07/26 13:28:42 UTC
bug?
Ok- I'll try again-
I'm trying to use the nested:iterate tag to iterate through a graph of
collections. I'm using the following code (***note that I've removed
non-collection type attributes from the sample code to save space***).
<nested:nest property="reportForm"/>
Report Name: <nested:write property="reportName"/> <!-- property not shown
in following java code sample -->
<nested:iterate property="years">
<nested:write property="year"/> <!-- property not shown in following
java code sample -->
<nested:iterate property="weeks">
<nested:write property="week"/> <!-- property not shown in following java
code sample -->
</nested:iterate> <!-- week -->
</nested:iterate> <!-- year -->
</nested:nest> <!-- reportForm -->
public class Report extends org.apache.struts.action.ActionForm
implements java.io.Serializable
{
private ArrayList years = new ArrayList();
public Object[] getYears()
{
return years.toArray();
}
public void setYears(ArrayList argYears)
{
year = argYears;
}
}
public class Year implements java.io.Serializable
{
private ArrayList weeks = new ArrayList();
public Object[] getWeeks()
{
return weeks.toArray();
}
public void setWeeks(ArrayList argWeeks)
{
weeks = argWeeks;
}
}
public class Week implements java.io.Serializable
{
private String week;
public String getWeek()
{
return week;
}
public void setWeek(String argWeek)
{
week = argWeek;
}
}
When this code runs I get the following error:
javax.servlet.jsp.JspException: No getter method for property years[0].weeks
of bean reportForm
The getter is clearly there. When I walk the code with my debugger, it
seems that the descriptor array created deep down in the Iterator code does
not contain my getWeeks method. Why is that??? It recognizes getYears. Is
this a bug in the tags? Your answers are greatly appreciated.
thanks,
Jim
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>