How tomcat servlet container class instance is created

When the container starts, it will read web.xml files for all web applications in the webapps directory, and then parse xml file, and read the servlet registration information.

Then, each registered application loaded servlet class, and by way of example of the reflection. (Sometimes also in the first instance of the request)

Plus <load-on-startup> 1 </ load-on-startup> if positive, then it is instantiated at the outset, if not written or is negative, then the first request when instantiated register servlet.

Guess you like

Origin www.cnblogs.com/yanguobin/p/11619072.html