Page 1 of 1

About Question enthuware.jwpv6.2.637 :

Posted: Tue Nov 24, 2015 11:11 pm
by renatumb
If metadata-complete="true" were declared in web.xml, wouldnt the web-fragment be merged into web.xml ?

How about declare metadata-complete="true" in web-fragment.xml ? Only the annotations wouldnt me processed?

Re: About Question enthuware.jwpv6.2.637 :

Posted: Wed Nov 25, 2015 12:06 am
by admin
If web.xml has metadata-complete=true, then web fragments will not be included.
As per Section 15.5:
If metadata-
complete is set to " true ", the deployment tool only examines the web.xml file and
must ignore annotations such as @WebServlet , @WebFilter , and @WebListener
present in the class files of the application, and must also ignore any web-
fragment.xml descriptor packaged in a jar file in WEB-INF/lib .
and
The web-fragment.xml also contains the metadata-complete attribute on the web-
fragment element. The attribute defines whether the web-fragment.xml descriptor
is complete for the given fragment, or whether it should scan for annotations in the
classes in the associated jar file. If metadata-complete is set to “ true ” the
deployment tool only examines the web-fragment.xml and must ignore annotations
such as @WebServlet , @WebFilter and @WebListener present in the class files of the
fragment.