> Katarina Nelson wrote:
>
> Hi,
>
> I try on my jsp page iterate an indexed property.
> I get this exception:
> "javax.servlet.ServletException: Invalid indexed property
> 'routingData[<%=s%>]'"
>
> My code:
> <%
> int counter = 0;
> String s = null
> s.valueOf(counter);
> for (int i = 0; i < myRoutingList.getRouteElements().size(); i++) {
> %>
>
> <tr>
> <td class="input">
> <html:text property="routingData[<%=s%>].timeOfDayStart"
> size="6"/></<td class="input">
> <html:text property="routingData[<%=s%>].timeOfDayStop" size="6"/>
> </td>
> </tr>
> <%
> counter++;
> s = s.valueOf(counter);
> }
> %>
>
> I tried both with counter as an int and a string . No one seems work.
> Do somebody know what´s is the problem?
>
> Thanks,
> Katarina
>
>
> <%=s%>
>
jsp RTE expressions are an all or nothing gig when specifying
attribute values for a tag, so the following is illegal:
<html:text property="routingData[<%=s%>].timeOfDayStart" size="6"/>
try this instead:
<html:text property='<%="routingData["+s+"].timeOfDayStart" %>' size="6"/>
(NOTE the single quotes around the RTE to prevent the JSP parser from
getting terminall confused by the embedded double quotes within the
RTE)
hope that helps,
e
--
_______________________________________________________________________
Elod Horvath ('e') / ITFAIS Records (http://www.itfais.com/)