File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JSP and the fly likes JSP Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Java » JSP
Reply Bookmark "JSP" Watch "JSP" New topic
Author

JSP

Rajesh KG
Greenhorn

Joined: Feb 24, 2003
Posts: 2
I am developing a foam using JSP. How can I display values, which is selected from the database, in the listbox using <option value selected>value</option>
Rakesh Gadre
Ranch Hand

Joined: Feb 22, 2003
Posts: 47
You can try this syntax:
<html>
<form>
<select name="myname">
<%
while(rs.next())
{
%>
<option value="<%=rs.getString(1)%>"><%=rs.getString(1)%>
<%
}
%>
 
IntelliJ Java IDE
 
subject: JSP
 
Threads others viewed
getting data from html drop down list to jsp
how to change select menu dynamically in a JSP
Null vs empty string
Values
combo box selection in jsp
developer file tools