File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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

Win a copy of REST with Spring (video course) this week in the Spring forum!
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 ~ Raspberry Alpha Omega ~ Frank's Punchbarrel Blog
I agree. Here's the link:
subject: About Servlet
It's not a secret anymore!