You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Ramakrishna Reddy Kandula <rk...@cisco.com> on 2001/07/17 03:35:43 UTC

indexed property iteration

How do I achieve indexed property access dynamically ?

The following doesn't work.

<html:form name='testForm' type='test.TestForm' action='test.do'>
<%
   TestForm testForm = (TestForm) session.getAttribute("testForm");
   int i = 0;
   for (i=0; i < testForm.getNames().length; i++) {
%>
   Text: <html:text property='names[i]'/>
<%
   }
%>
   <html:submit>Go</html:submit>
</html:form>

It says,
javax.servlet.ServletException: Invalid indexed property 'names[i]'

Thanks,
ramky