I am giving a try on Tomcat 7.0 and Servlet API 3.0.
I had an application for Servlet API 2.5. So I edited web.xml to configure it for Servlet API 3.0. After the change the start time of Tomcat increased by 14 seconds.
So I set <web-app metadata-complete="true" ...
and the start time of Tomcat got back to normal, because tomcat does not scan every class for annotations. This is good, but web-fragment.xml feature is also disabled by this.
I wonder if it possible to disable annotation scanning of Tomcat, but to enable processing of web-fragment.xml.
Consider using 'absolute-ordering' element in your web.xml. Servlet API 3.0 Final Spec describes it's usage in section 8.2.2 "Ordering of web.xml and web-fragment.xml".
You can specify the exact web-fragments to be processed, disable annotations processing of classes in web-fragment's jar ('metadata-complete' in the web-fragment from the list) and of course exclude other jars from processing by this kind of web-fragment inclusion.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With