Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

to pass variable to servlet from html

 
anamika das
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a table with a checkbox in each row..and a submit button at the end.
On click of the submit button the named or id's of the checkboxes clicked should reach the servlet called from action tag of the html or jsp form
 
David O'Meara
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
OK.

Is there a question?
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you're going to program for the web, you'll need to get a basic understanding of HTTP and how HTTP Forms work. This is the same whether you're using Servlets, JSP, PHP, ASP, Perl, DOT_NET, etc...

This chapter
http://csajsp-chapters.corewebprogramming.com/CSAJSP-Chapter16.pdf covers them.

If you're going to write servlets, I highly recommend reading the whole book - as well as the 2nd edition "More Servlets and Java Server Pages".
 
samdeep aarzoo
Ranch Hand
Posts: 160
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
send parameter from html to jsp or servlet

first go there try to do that excercise
hope this helps
 
vivek parepalli
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It is a trivial question. You can use the following methods to retrieve info from your HTML file.

<request object>.getParameter(<Parameter name> ;
 
Amitav Anand
Ranch Hand
Posts: 46
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Anamika,

I guess u r trying to develop shopping cart sort of application.
Anyways the problem is quite simple..
Just use the getParameter() method of the HttpServletRequest object and access the parameter names..
Then store the corresponding rows into the database.
If u could send the source code of the program...I will try to solve your problem..

bye
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic