GeeCON Prague 2014*
The moose likes Servlets and the fly likes JSP To Servlet Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Java » Servlets
Bookmark "JSP To Servlet" Watch "JSP To Servlet" New topic
Author

JSP To Servlet

Aris Doxakis
Ranch Hand

Joined: Dec 05, 2004
Posts: 136

Hello,

I have created a drop down list that fills with data from a database.From a table called category.it is used for a search form.when the user cliks the submit button it triggers a servlet(search.java).how can i take the value from the drop down list and use it in the servlet???the drop down list is created with simple html <selection> <option>

thnx in advance
Tim Baker
Ranch Hand

Joined: Oct 04, 2003
Posts: 541
Inside your doGet method:



You really do need to buy a book on JSP and Servlets


Kim Jong II (North Korea's Dear Leader) said:Nuclear weapons don't kill people, people kill people.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61310
    
  66

Moved to the Servlets forum.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61310
    
  66

Inside your doGet method:


or doPost method -- whichever is approriate.
Aris Doxakis
Ranch Hand

Joined: Dec 05, 2004
Posts: 136

I allready tried that but it doesnt work.
i have to take the value from the selection swaping between the options with a for and then take the value from it.
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

Originally posted by Aris Doxakis:
I allready tried that but it doesnt work.


Post your code.


You really do need to buy a book on JSP and Servlets


Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12791
    
    5
A book on HTML would be a good idea too since your HTML has to be correctly formed for servlets and JSP to work. At least download the Specifications from www.w3.org - just as you should also have the Specifications for the Servlet and JSP APIs on your computer.
I really love the _Hip Pocket Guide to HTML 4_ but it is out of print and hard to find.
Bill
 
GeeCON Prague 2014
 
subject: JSP To Servlet