I'm trying to loop through a vector, detokenize it's results and display them in a drop down list box on my jsp page. Unfortunately, it doesn't seem to be looping correctly. My list box displays empty. Does anyone see what I'm doing wrong? I'm new to Vectors so it may be something simple. Thanks!
CrystalVisualBOracle
<% Vector v_companies = new Vector();
UserData DataObj = new UserData();
v_companies = DataObj.Get_Companies(); // This method call returns a filled vector
%>
...
<P><TD NOWRAP=TRUE COLSPAN=3><FONT FACE ="Arial, helvetica" size=-2>COMPANY:
<select NAME="Company">
<%
int num_companies = v_companies.size();
for(i=0; i>num_companies; i++) {
String co = (String)v_companies.get(i);
try {
StringTokenizer st_co = new StringTokenizer(co, "{", false);
while (st_co.hasMoreTokens()) {
String companyname = st_co.nextToken();
String s_compid = st_co.nextToken();
%>
<option VALUE="<%=s_compid%>"><%=companyname%>
<option VALUE="1">IN HERE
<%
}
}
catch (NoSuchElementException ee) {
System.err.println("No More Elements Found" + ee.toString());}
}
%>
CrystalVisualBOracle
<% Vector v_companies = new Vector();
UserData DataObj = new UserData();
v_companies = DataObj.Get_Companies(); // This method call returns a filled vector
%>
...
<P><TD NOWRAP=TRUE COLSPAN=3><FONT FACE ="Arial, helvetica" size=-2>COMPANY:
<select NAME="Company">
<%
int num_companies = v_companies.size();
for(i=0; i>num_companies; i++) {
String co = (String)v_companies.get(i);
try {
StringTokenizer st_co = new StringTokenizer(co, "{", false);
while (st_co.hasMoreTokens()) {
String companyname = st_co.nextToken();
String s_compid = st_co.nextToken();
%>
<option VALUE="<%=s_compid%>"><%=companyname%>
<option VALUE="1">IN HERE
<%
}
}
catch (NoSuchElementException ee) {
System.err.println("No More Elements Found" + ee.toString());}
}
%>