Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

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

 
Jack Lau
Ranch Hand
Posts: 168
  • Mark post as helpful
  • send pies
  • 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
 
Sanjay pts
Ranch Hand
Posts: 357
  • Mark post as helpful
  • send pies
  • 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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic