Welcome Guest.

1Answers

Explain what is the servlet and serlvet life cycle and the basic architecture of the Servlet

Asked by: Carolyn King 214 views IT November 4, 2018

Explain what is the servlet and serlvet life cycle and the basic architecture of the Servlet

1 Answers

  1. +3Votes  

    After the servlet is instantiated by the server, the container runs its init method. When the request arrives, it runs its service method. The service method automatically dispatches the doXXX method (doGet, doPost) corresponding to the request, when the server decides to destroy the instance. Call its destroy method. The difference with cgi is that the servlet is in the server process, it runs its service method in multi-threaded mode, an instance can serve multiple requests, and its instances are generally not destroyed, and CGI generates new processes for each request. The service is destroyed after it is completed, so it is less efficient than the servlet.

    Roger- November 4, 2018 |