May 2001
Intermediate to advanced
1088 pages
30h 13m
English
You've seen that two prebuilt servlet classes are available for you to subclass, but so far, you don't know why you would choose HttpServlet instead of GenericServlet. The main difference between the two is that HttpServlet has extra methods and special request and response objects that are geared toward the HTTP protocol. The HttpServlet provides separate methods for handling the different types of HTTP requests (GET, POST, PUT, and so on). The two most common types of HTTP requests are GET and POST, which are handled by the doGet and doPost methods:
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, java.io.IOException; protected void doPost(HttpServletRequest request, ...
Read now
Unlock full access