Doubt in servlet

Hi

I am using servlets to connect to a database and display it in the form of HTML table. I need to assign a radio button to each row. This table contains around 100 rows. THe radio button should be a column before "Name". How can I assign a radio button to each row without doing 100 times like

<input type=radio name="id" value="1"> <input type=radio name="id" value="2"> ...so on for each row because I am using result set to display the table.

while(rs.next())

{

out.println("<TR>");

out.println("<TD>" + rs.getString("NAME") +"</TD>");

out.println("<TD>" + rs.getString("PHONE") +"</TD>");

out.println("<TD>" + rs.getString("ADDRESS") +"</TD>");

out.println("<TD>" + rs.getString("ADDRESS") +"</TD>");

out.println("</TR>");

}

ex table:

Name Phone AddressState

asdasddasddasd

sadadasddasdsadas

sdadasdsadasdasd

Any help would be greatly appreciated

Thanks

[1534 byte] By [goBIGRED] at [2007-9-26 4:11:25]
# 1

int i=1;

while(rs.next()){out.println("<TR>");out.println("<TD>" + rs.getString("NAME") + "</TD>");out.println("<TD>" + rs.getString("PHONE") + "</TD>");out.println("<TD>" + rs.getString("ADDRESS") + "</TD>");out.println("<TD>" + rs.getString("ADDRESS") + "</TD>");out.println("</TR>");

<input type=radio name="id" value="+i+">

i++;

}

priviet at 2007-6-29 13:16:18 > top of Java-index,Archived Forums,Java Programming...