You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Xin Li <xl...@seasllc.com> on 2001/12/28 17:05:45 UTC
a problem with struts logic:iterate
Hi,
I tried to use logic:iterate to populate a table. I used
<logic:iterate id="i_tableArr" name="keyTableArray" indexId="row_index">
<tr><td>this is the test page</td></tr>
</logic:iterate>
KeyTableArray is the attribute, which contatains an ArrayList.
When I try to run the the application, it gave me the following error:
org.apache.jasper.compiler.CompileException: Unable to find setter method
for attribute: indexId
Can anybody tell me why this happens? I would appreciate if an example of
how to use iterate to populate a table is provided.
Xin
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>
Re: a problem with struts logic:iterate
Posted by Ted Husted <hu...@apache.org>.
Using the iterate tag to create the HTML for table is no different than
creating any type of HTML.
You might take a look a the struts-exercise-taglib example in the
distribution. This tests iterating over a String array and an ArrayList.
You could try placing this page in your application, substituting your
own JavaBeans, and continuing from there.
Of course, in a production application, the beans should be created in
an Action and forwarded to a page, rather than be created by scriplets
as is done on the test page. But having a page like this can be very
handy for initial development.
Xin Li wrote:
>
> Hi,
>
> I tried to use logic:iterate to populate a table. I used
> <logic:iterate id="i_tableArr" name="keyTableArray" indexId="row_index">
> <tr><td>this is the test page</td></tr>
> </logic:iterate>
>
> KeyTableArray is the attribute, which contatains an ArrayList.
>
> When I try to run the the application, it gave me the following error:
>
> org.apache.jasper.compiler.CompileException: Unable to find setter method
> for attribute: indexId
>
> Can anybody tell me why this happens? I would appreciate if an example of
> how to use iterate to populate a table is provided.
>
> Xin
>
> --
> To unsubscribe, e-mail: <ma...@jakarta.apache.org>
> For additional commands, e-mail: <ma...@jakarta.apache.org>
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>