XML fragment of TOMCAT7 and discovery processing logic of annotated resource

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.