wood burning stoves 2.0*
The moose likes Servlets and the fly likes About Servlet Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "About Servlet " Watch "About Servlet " New topic

About Servlet

Ranch Hand

Joined: Nov 22, 2008
Posts: 18944
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

Joined: Jan 07, 1999
Posts: 6920
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.
The HTML contains:

and the servlet contains:

Read about me at frankcarver.me ~ Raspberry Alpha Omega ~ Frank's Punchbarrel Blog
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
subject: About Servlet
Similar Threads
Cant use object from another class
WA #1.....word association
Posting to bump up my count...
Text box value is not being completely filled with request attribute
The x900 effect ?