• The HttpMethodTestServlet prints the method name of the request on the Tomcat console.

    A click on /chapter04/servlet/HTTPMethodTestServlet?name=john will send a GET request.

    Submitting the following form will send a POST request:

  • The init() method of HTTPMethodTestServlet illustrates how to retrieve servlet initialization parameters. It prints the names and values of these parameters on the console when the servlet is initialized.