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.
As per my understanding, "protected" modifier of doGet() means that a client has to be in the same package (or a child - through inheritance) to access doGet(). So how will the invoking JSP or the Container access it?
Hope my question makes sense.
"A problem well stated is a problem half solved.” - Charles F. Kettering
SCJP 6, OCPJWCD
Pedro Kowalski wrote:I think that the container calls the Servlet.service(-) method (which is public). It then calls the HttpServlet.service(-) method which is protected and it then call doXxx(-) method.
So, the public access for Servlet.service(-) method is enough for the container to operate on servlet.
Got it! Didn't think of the public service(...) method between the container & the doXXX(...) methods!