<p>DISTRICT
<% int num = dataBean.getNumOfDistricts(); %>
<% out.println("No of Districts "+ num ); %>
<SELECT>
<REPEAT index=myindex <% out.println(" end = "+num); %> >
<INSERT>
<OPTION>$(bean=dataBean property=vctDistrict(myindex))
</INSERT>
</REPEAT>
</SELECT>
</p>
You can't do it this way because the REPEAT tag works only with
constant indices.
Rewrite your code as follows:
<SELECT>
<REPEAT index=myindex>
<% dataBean.getVctDistrict(myindex) %>
<INSERT>
<OPTION>$(bean=dataBean
property=vctDistrict(myindex))
</INSERT>
</REPEAT>
</SELECT>
And have the getVctDistrict(myindex) method throw an
ArrayIndexOutOfBoundException when
the index is not valid. The exception will break you out of the loop.
BTW has anyone figured how I can get multi-parameter get methods to
work yet? i.e.
<REPEAT index="x">
<% bean.checkIndex(x) %>
<REPEAT index="y">
<% bean.checkIndex(y) %>
<INSERT bean="bean" property="someProperty(x,y)">
</INSERT>
</REPEAT>
</REPEAT>
WAS always complains that the property cannot be found if I specify
more than one
parameter. It works with zero and one parameter but not with two or
more? Why???
-Hai
===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff JSP-INTEREST". For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".