I have a JSP page with a drop down list that is to be populated with values from a database.
This is the code in my JSP file:
The DataManager.java class simply forwards this to its respective Peer class, which has the code shown below:
The classes compile properly, but when I load this page up in Tomcat it just freezes and does not load the form. I tested the DB connection and it works fine.
What am I doing wrong in the JSP code?
Thanks for the help in advance.
UPDATE: I commented out the form, and added <%=floornumbers.size()%> right above the commented code to check if the ArrayList is indeed getting populated with the values from the database (the values are of type integer in the database). The page still freezes like before. I'm puzzled now .
[ January 11, 2008: Message edited by: Sridhar Venkataraman ]
Originally posted by Ben Souther:
Not sure if this is the problem but, is this what you really want?
Each call to iterator.next(), pops off the next value in the list.
So, if you had a list containing "1", "2", "3", "4", "5",
your options would look like:
Now that you've mentioned it, what I really wanted was:
<option value="1"> 1 </option>
and so on....
I can fix that easy. But why doesn't the code work? There seems to be no error with the DB connection or the query, and yet the page doesn't render.