This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line!
See this thread for details.
The moose likes Servlets and the fly likes using drop down list Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

JavaRanch » Java Forums » Java » Servlets
Bookmark "using drop down list" Watch "using drop down list" New topic

using drop down list

Shumaiza Manzoor

Joined: Sep 03, 2001
Posts: 6
hi all,
please tell me how to use drop down list in servlets, as i write a code in html, but it is a static list, i gave 4 or 5 elements and it displays, but i want to list that displays data from data base field.
i want that,when i insert data in database column the data automatically be viewed in that list.
please help.
Dharmesh Chheda
Ranch Hand

Joined: May 08, 2001
Posts: 204
Hello Shumaiza
i hope this code solves your problem
Assuming that you got the resultset
out.println("<select name=\"Location\">");
out.println("<option value=\" "+resultset.getString(1)+"\">+resultset.getString(1)+"</option>");
out.println("<option value=\" "+resultset.getString(1)+"\">+resultset.getString(1)+"</option>");
IBM Certified WebSphere Application Server V3.5 Specialist
[This message has been edited by Dharmesh Chheda (edited September 06, 2001).]

regards,<br />Dharmesh Chheda
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link:
subject: using drop down list
It's not a secret anymore!