You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Henry Lu <zh...@umich.edu> on 2002/02/19 14:30:40 UTC
tag
Could someone tell me why the following code doesn't work? How to make it
work?
////////////////////////////////////////////////////////////////////////////
public class MyClass_1
{
...
}
///////////////////////////////////////////////////
public class MyClass_2 extends MyClass_1
{
...
public ArrayList runList()
{
Arraylist lst = new ArrayList();
MyClass m;
m.id="123";
m.name="John";
lst.add(m);
return lst;
}
}
///////////////////////////////////////////////////
public class MyForm extends ActionForm
(
...
private ArrayList lst;
public ArrayList getLst()
{
MyClass_2 m2;
this.lst = m2.runList();
return this.lst;
}
public void setLst(ArrayList lst)
{
this.lst = lst;
}
}
//////////////////////////////////////////////////////////////
<table>
<logic:iterate id="theList"
name="MyForm" property="lst"
type="MyClass_2">
<tr><td>
<bean:write name="theList" property="id"/>
</td><td>
<bean:write name="theList" property="name"/>
</td></tr>
</logic:iterate>
</table>
////////////////////////////////////////////////////////////////
---------------------------------------------------------------------------
Henry Lu
MCIT phone: (734) 936-2063
University of Michigan Medical Center fax: (734) 763-4372
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>