When I was visiting a bookstore, I accidentally found this book amazing. So I bought it and showed it to the students. After a few months, I am idle and ready to look at the system. Although I have made two struts, spring, and hibernate projects, I feel that the knowledge is not very systematic.
1. servlet does not have the main () method, and they are controlled by another Java application called "Container:
HTTP request -----> Web Server ----- (Servlet request)
-----> Servlet container (create httpservletresponse and httpservletrequest and pass them to matching dservlet)
-----> Call the servlet Service () method to determine the request type and call dopost () or doget ()
Container function:
- Communication support: establishes a serversocket and listens to a port for communication with the Web server.
- Lifecycle management: Load classes, instantiate and initialize Servlets, call servlet methods, and recycle servlets.
- Multithreading support: Creates a new thread for each Servlet Request
- Security Declaration: Use the XML deployment description file to configure and modify Security
- JSP support: translate JSP code into real Java