Quotation marks when mixing jsp and html forms

D

deepstar

Hey all

I'm trying to generate one list item per Sql row, but the code instead
generates four individual droplists containing one item each. Any ideas
on what might be wrong?

ResultSet rslt = addStmt.executeQuery("SELECT name FROM topic");
ResultSetMetaData rsmd = rslt.getMetaData();

for (int i = 1; i <= rsmd.getColumnCount(); i++) {

while(rslt.next()) {
String getTopic = rslt.getString(i);
getTopic = rslt.getString("name");
%>

<H3>Available topics:</H3>
<br/>
<form METHOD"POST" ACTION="mockup.jsp">
<select size="1" name="view">
<option value="yes"><% out.println(getTopic);%></option>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,050
Latest member
AngelS122

Latest Threads

Top