struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Siggelkow, Bill" <>
Subject RE: indexed property iteration
Date Tue, 17 Jul 2001 13:13:05 GMT
What you *really* should do is use the Struts "iterate" tag in the logic
Using scriptlet is generally a *bad* thing ... however, if you really wanted
to do this you need to use a JSP expression for the property value like this
   Text: <html:text property='<%=names[i]%>'/>

-----Original Message-----
From: Ramakrishna Reddy Kandula []
Sent: Monday, July 16, 2001 9:36 PM
Subject: indexed property iteration

How do I achieve indexed property access dynamically ?

The following doesn't work.

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

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


View raw message