File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
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


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "servletl" Watch "servletl" New topic
Author

servletl

lathainses muthu
Greenhorn

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
Bartender

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
Sheriff

Joined: Aug 03, 2008
Posts: 9304
    
  17

Here's the code

HTML

<select name="whatever">
<option>First</option>
<option>Second</option>
<option>Third</option>
</select>

Servlet

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


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

Joined: Jan 10, 2002
Posts: 61413
    
  67

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] [Bear's FrontMan] [About Bear] [Books by Bear]
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: servletl