1. Metadata-complete Properties
Deployment profile for Servlet 3.0 The top-level label for Web. XML <web-app> has a Metadata-complete property that specifies whether the current deployment profile is complete. If True, represents the deployment profile, covering all content (that is, pluggable annotation support is not supported.) ), if False, in addition to parsing the deployment description file, the associated jar package will also be parsed with "Declaration processing annotations".
2, Web-fragments is through the Jarscanner to scan, and then corresponding callback to do file recognition and resolution.
Even if there is no "meta-inf/web-fragment.xml" in this process, an empty Webxml object is generated. But why? This is equivalent to identifying all the jar packages, preparing for the subsequent scan of the class file (see 3rd), which is equivalent to having a base path. Also, when Metadata-complete=false, although an XML fragment may not exist, there may be instances of annotations that have a response.
3, Servletcontainerinitailizer and @handlertypes annotation.
Through the service load mechanism, discover the implementation of the servletcontainerinitailizer that you want to add in the corresponding resource configuration file,
Then see if the SCI has an annotated handlertypes (want to be scanned), then add SCI to the context,
Context.startinternal executes once Sci.onstartup () is executed, and the parameter is the filtered class collection of all associations.
XML fragment of TOMCAT7 and discovery processing logic of annotated resource