Win a copy of Learn Spring Security (video course) this week in the Spring forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JSP To Servlet

 
Aris Doxakis
Ranch Hand
Posts: 136
Android Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 541
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Inside your doGet method:



You really do need to buy a book on JSP and Servlets
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64608
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Moved to the Servlets forum.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64608
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Inside your doGet method:


or doPost method -- whichever is approriate.
 
Aris Doxakis
Ranch Hand
Posts: 136
Android Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13055
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic