Check for a behavior change in the processing of the absolute-ordering element

Servlet 3.1 introduces a change in how the <absolute-ordering> element is processed when the web.xml file contains the metadata-complete="true" attribute. In Servlet 3.0, when the metadata-complete attribute is set to "true", all web fragment archives are used. In Servlet 3.1, the <absolute-ordering> element is considered to be complete, which causes web fragments that are not listed in the <absolute-ordering> element to be excluded from processing. The Servlet 3.1 feature might change existing application behavior by excluding web fragments that were previously included.

This rule flags the <name>B</name> element in the web-fragment.xml file if the web.xml file contains the metadata-complete="true" attribute and the <absolute-ordering> element does not contain an entry for the web fragment name.

The following example demonstrates the behavior change when you use a combination of a web.xml file and a web-fragment.xml file:

web.xml:

<absolute-ordering>
	<name>A</name>
	<others/>
</absolute-ordering>

web-fragment.xml:

<web-fragment>
	<name>B</name>
</web-fragment>

In Servlet 3.0, web fragment B is included in processing. In Servlet 3.1, it is not included. To include web fragment B in processing, add a <name>B</name> element in the appropriate position within the <absolute-ordering> element in the web.xml file.

For more information on Servlet 3.1 behavior changes, see the following resource: Servlet 3.1 behavior changes.