aspose file tools*
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes HEAD 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 "HEAD" Watch "HEAD" New topic
Author

HEAD

Ankur Jain Kothari
Ranch Hand

Joined: Feb 08, 2010
Posts: 154
what will happen if a servlet is called with HEAD method but the doHead method is not present?

david's book says that we will get a 200 response code:SC_OK....is it right? but if this was for post method then we would get 405: method not allowed


Do What You Wanna Be....Taking Things The Way They Come
scjp 1.6 91 percent, scmad 90 percent(rounded off to nearest integer)
Ankur Jain Kothari
Ranch Hand

Joined: Feb 08, 2010
Posts: 154
i have read somewere here that doHead calls doGet method....if there is no doHead ten doGet is called....but what if both of them are not present? what repsonce code will i get...am reall confused about the reposnce codes..can someone help me with them..thanks
Ankur Jain Kothari
Ranch Hand

Joined: Feb 08, 2010
Posts: 154
If the servlet does not implement doHead , doGet will be called upon HTTP HEAD request.............is this right?
Brij Garg
Ranch Hand

Joined: Apr 29, 2008
Posts: 234
I dont think service method invokes doGet() in case doHead() method is not available in the servlet. Need to test it.

when HTTP head method is used then response header is exactly similar to the response header which will be sent when HTTP Get method is used. Only difference is, response header is not having any message body when Head method is used.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: HEAD