Core HTTP Servlet API

As you can see from Figure 3.4, when the HttpServlet receives a request from the browser, the service() method in the servlet is called, which in turn calls either the doGet() or doPost() methods in the servlet, depending on the type of HTTP request (GET or POST). The request data is received by the servlet from the browser as URL-encoded name-value pairs.

Figure 3.4. HTTP servlet request model.

The service() Method

This method is called for every request received by the HttpServlet from the browser. It is optional for a servlet to override this method.

The doGet() Method

This method is called for every HTTP GET request received ...

Get Sams Teach Yourself BEA WebLogic Server 7.0™ in 21 Days now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.