I. jsp
1) What is jsp: jsp is a new object of tomcat and a subclass object of httpservlet. The code in <%> is only a snippet of its class method. We can compile it by writing a webpage.
2) What is jsp mainly used for? It is mainly used for page rendering and passes user actions received from the browser to servlet, you can also receive data from the servlet to render pages that we can understand.
3) What are the features of jsp? A single instance (a class-1 Object) is a request object with multiple threads (a service receives the next service without termination.
4) how to eliminate the java code in jsp: We can use jstl + el (which will be explained in a blog post later ).
Ii. servlet
1) What is servlet? It is also an object generated by tomcat new. It inherits the httpservlet object. What is different from jsp is, the methods and configurations in it are written by the programmer, so that tomcat can recognize it and call its methods when appropriate. It is complete.
2) What is servlet mainly used for? It is mainly used to receive data from jsp, encapsulate the data and call the corresponding business for data transmission and page Jump, you can also transmit data from the service to jsp.
3) What are the working characteristics of servlet? single-instance multithreading is also the request object.
In fact, jsp and servlet pages can be combined into one, but the jsp page looks messy and not easy to rewrite or debug! ! !
3. filter
1) What is a filter? It is a filter and an object generated by tomcat new. Like servlet, we need to fill in the class methods and configurations in it by ourselves, to facilitate tomcat identification. Its Class method is an interface.
2) What are filters mainly used for? 1. Chinese Garbled text 2. Sensitive Word Recognition 3. user login verification
3) features of filter: Multiple instances are automatically enabled and disabled when not in use, just like hot plugging ports.
4. tomcat
Tomcat is the container of jsp and servlet. It is responsible for jsp and servlet instantiation and method calling.
The listener will be analyzed later ....