Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Agile forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

About Servlet

 
Anonymous
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have Four Buttons in my Html Form
i want to know how the server is going to identify which Button
is Pressed???
 
Frank Carver
Sheriff
Posts: 6920
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You give each button a name and a value, and they are passed as query parameters just like other form fields. Note that one common trick is to have multiple SUBMIT buttons - all with the same name, but different values - and use them to control what the servlet does with the form data.
eg.
The HTML contains:

and the servlet contains:
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic