Problem:
What is a container?
What is a JSP Container?
What is the role of JSP containers?
What is a JSP engine?
Analysis:
These problems are the same. They all describe how JSP or servlet objects are managed or run.
Answer:
First, we should understand that JSP or servlet operations and common clientsProgramClient programs are called directly. jsp or servlet operations require servers, which are usually called application servers. servers are responsible for creating JSP or servlet objects, then, call the corresponding methods of the JSP object or servlet object.
Who created the JSP or servlet object and called the method? It is done by a container, or a JSP Container.
Containers are used to hold other components. These components include JSP or servlet to create component objects, call methods, and destroy objects.
How does the container know which JSP or servlet object to create? For JSP, it is determined by the file name, and for servlet, it is determined by the configuration in Web. xml.
How does the container know which method to call JSP or Servlet? For JSP, the JSP page is converted to a Java class, and the content in the page is converted to the content of a method in the Java class, and the name of this method is fixed, the container will call this method. For Servlets, you need to write the doget or dopost methods based on the request type. The container will call the doget or dopost methods respectively based on the Request Method "get" or "Post.