This week's book giveaway is in the OCAJP forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide 1Z0-808 and have Jeanne Boyarsky & Scott Selikoff on-line! See this thread for details.
Hi Ranchers, I know that Head method works exactly like the get method but it only returns the HTTP header information without any body. However I have never seen any example till now in which doHead() is overrriden. Hence Could you please let me know 1) How to print the HTTP Header information using doHead() i.e.what whould be defintion of overriden doHead() ? 2) How to make a HEAD request from the browser ?
Somesh I am not a pro at this, but I think you cannot make head requests from a browser. For this I think you will have to make a small program and connect to the servlet using URL class or making a SocketConnection.
As far as doHead method is concerned, I have again not read the specs but in one of my books I read that doHead internally calls doGet and sends back only the response headers. This may be wrong as I have not read about this in any other books...