Java Web can be roughly divided into two aspects: 1. Client 2. The communication between the server is the http protocol.
Java Web has four components: jsp, servlet, filter, and listener. They all have tomcat instantiation and are called as appropriate.
1. jsp: it is an implementation class subclass of httpservlet. we can write it in the form of a webpage. For the code in <%>, it is only a small part of the class method.
2. servlet: it is also an implementation class of httpservlet, but the methods and configurations in it need to be completed by the programmer, so that the next work can be handed over to tomcat.
3. filter: It mainly filters "request resources" (jsp, servlet, and filter, the operation is mainly used for "preprocessing" and "subsequent work" after processing. It needs to be customized and configured like servlet.
4. listener: listener for the relevant events of the application and session objects.