Two Laptop Bag
The moose likes Servlets and the fly likes HTML method for service()? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "HTML method for service()?" Watch "HTML method for service()?" New topic

HTML method for service()?

Ashish Hiriadka

Joined: Feb 27, 2011
Posts: 5
Thanks Paul for the reply I have another doubt. if we override only service method and if we are calling the servlet from html form action, which HTTP method we have to use??
Paul Clapham

Joined: Oct 14, 2005
Posts: 19973

That's the wrong question. You don't decide to write your HTML based on how somebody decided to write the servlet. It's the other way around. You write your HTML and decide whether to use GET or POST based on the usual meaning of those methods. Then you write the servlet which processes the request and use doGet or doPost based on how you decided to write your HTML.
I agree. Here's the link:
subject: HTML method for service()?
jQuery in Action, 3rd edition