jQuery in Action, 3rd edition
The moose likes Servlets and the fly likes servletl Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "servletl" Watch "servletl" New topic


lathainses muthu

Joined: Aug 06, 2008
Posts: 5
i am doing small project in jsp
in this i am using jsp, java servlet and html
i need to store result set in combobox using java servlet
i have two files combo.jsp and combo.java
how to get value in combobox using java servlet -html option
if anybody know this program please help me
Paul Sturrock

Joined: Apr 14, 2004
Posts: 10336

HTML doesn't have anything called a combobox, so I'm assuming you have implemented this using the select element? You can get at the value of the selected option by calling the getParameter() method on the request. The name of the parameter will be the name of your select element, the value will be the selected value.

JavaRanch FAQ HowToAskQuestionsOnJavaRanch
Ankit Garg

Joined: Aug 03, 2008
Posts: 9465

Here's the code


<select name="whatever">


String selectedValue = request.getParameter("whatever");

SCJP 6 | SCWCD 5 | Javaranch SCJP FAQ | SCWCD Links
Bear Bibeault
Author and ninkuma

Joined: Jan 10, 2002
Posts: 63858

Please be sure to take the time to compose descriptive subjects for your posts; read this for more information.

Using a title of "servletl" [sic] in a forum completely dedicated to questions on Servlets isn't very helpful.

Please go back and change your post to add a more meaningful subject by clicking the .
[ August 06, 2008: Message edited by: Bear Bibeault ]

[Asking smart questions] [About Bear] [Books by Bear]
I agree. Here's the link: http://aspose.com/file-tools
subject: servletl
It's not a secret anymore!