Ans Given: Code compiles, a blank page is displayed. Explanation: If you enter an address in the address line of your browser then the HTTP GET method is triggered. The doGet method is not implemented and will use the default value of the HTTPServlet class.
When you want to trigger the HTTP GET method you should override the doGet method. When you have an HTML form and submit it to the server the doPost method is triggered.
But i tried writing a servlet with only a doPost method and accessed it by typing the url and this is what i got HTTP Status 405 - HTTP method GET is not supported by this URL
type Status report
message HTTP method GET is not supported by this URL
description The specified HTTP method is not allowed for the requested resource (HTTP method GET is not supported by this URL). Apache Tomcat/5.0.28
So is the above answer wrong? [ March 01, 2005: Message edited by: Sharma Anjali ]