Tomcat loads JSP mainly has the following classes: Jspservletjspservletwrapperjspcompilationcontextjspruntimecontextjsperloadercompiler These classes are all in the Jasper.jar package 1. Tomat the HTTP request through the servlet to Jspservlet2.jspservlet in the context of Jspruntimecontext find Jspservletwrapper, if not found on the new instance, found the words to take out to use 3.JspServlet Wrapper initialization will also initialize a Jspcompilationcontext4.jspservlet service method to transfer the request to Jspservletwrapper to process 5.JspServletWrapper will determine whether the system allows reloading thi S.options.getdevelopment, If you allow the compile method that calls Jspcompilationcontext's compilation method Compile6.jspcompilationcontext to determine if the reference to the ClassLoader Jsperloader is set by judging the timestamp of the JSP file Null7.jsps Ervletwrapper uses the Getservlet method to load (Load method) JSP-compiled class class from Jspcompilationcontext and instantiates 8. Jspcompilationcontext class at load, first to get jsperloader, if it is null will create a new instance, Then let the Jsperloader loader load the JSP class9.jspservletwrapper get the instantiated servlet, the request that Jspservlet turned over to this servlet processing
Tomcat Load JSP principle