Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

servletl

 
lathainses muthu
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Ankit Garg
Sheriff
Posts: 9521
22
Android Google Web Toolkit Hibernate IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Here's the code

HTML

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

Servlet

String selectedValue = request.getParameter("whatever");
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64982
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic