aspose file tools*
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes How to submit a request in order to handled by doHead ? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Bookmark "How to submit a request in order to handled by doHead ?" Watch "How to submit a request in order to handled by doHead ?" New topic
Author

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

Jack Lau
Ranch Hand

Joined: Aug 30, 2002
Posts: 166
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

Joined: Nov 07, 2000
Posts: 357
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


Eat JAVA, Drink JAVA, Sleep Java
 
Consider Paul's rocket mass heater.
 
subject: How to submit a request in order to handled by doHead ?