March 2008
Intermediate to advanced
911 pages
20h 31m
English
Servlets don’t have a main() method. They’re under the control of another Java application called a Container.
Tomcat is an example of a Container. When your web server application (like Apache) gets a request for a servlet (as opposed to, say, a plain old static HTML page), the server hands the request not to the servlet itself, but to the Container in which the servlet is deployed. It’s the Container that gives the servlet the HTTP request and response, and it’s the Container that calls the servlet’s methods (like doPost() or doGet()).


Read now
Unlock full access