This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
Check out the API for HttpServlet. doGet() is called by the service() method to handle GET requests. doHead() is called by the service() method to handle HEAD requests.
Joined: Sep 14, 2001
I have read the API of HttpServlet. In doGet() method, It say that "Overriding this method to support a GET request also automatically supports an HTTP HEAD request" Back to my question before, If I have servlet class that have method doGet() and doHead(), which method from both will be called by container to allow its servlet to handle a HEAD request? daniel
Your doHead() will handle the HEAD requests, and the doGet() will service the GET requests. doGet() will handle HEAD requests in the absence of an overridden doHead() method. Well that's what I was told anyway Try it out.