Multiple choice technology web technology

What is true about Servlet’s service method?(Choose all that apply)

  1. The service() method is the heart of the servlet.

  2. Each request message from a client results in a single call to the servlet's service() method

  3. The service() method reads the request and produces the response message from its parameters

  4. The service() method is called to allow your servlet to clean up any resources before the servlet is unloaded.

  5. The InputStream from the client can be obtained via the getInputStream() method

Reveal answer Fill a bubble to check yourself
A,B,C,E Correct answer
Explanation

The service() method is indeed the core of a servlet - every client request triggers a single call to service(), which reads the HttpServletRequest and produces the HttpServletResponse. The InputStream from the client can be obtained via request.getInputStream(). Option D describes the destroy() method, not service().