1. Division of labor
Servlet: Responsible for processing the business and get the results of the processing
JSP: Not responsible for processing business, mainly to write the results processed in the Servlet to the response body
Analogy the relationship between the two: like a chef and a passer, Servlet is equivalent to a chef, and JSP is a passer
2. The calling relationship between Servlet and JSP
After the Servlet processes the data, it usually applies to Tomcat to call JSP through request forwarding.
The process of execution can be viewed through debug in idea
Display JSP page