• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

How to submit a request in order to handled by doHead ?

 
Ranch Hand
Posts: 168
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Dear All,

In the html form, use method="POST" then the request will be handled by doPost() method. If use method="GET" then it will be handled by doGet() method. Then how to set the method so that the request is handled by doHead() method ?

Thanks,
Jack
 
Ranch Hand
Posts: 357
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi
We have mainly 2 method get/post.
Even if you call HEAD method server has default implementaion and call doGet method.

If you want to try that make one siple HTML with method="post" and call servlet.
in that you can write

if( request.getMethod.equalsIgnoreCase("GET"))
{
System.out.println("GET WILL EXECUTE");
}
else
{
System.out.println("ERROR");

}


If you want more referace about that use Dustin Callaway book.
thanx
sanjay
reply
    Bookmark Topic Watch Topic
  • New Topic