Description
Considering the definition of welcome-files, the 3.1 specification says that:
pg 8-79: The web.xml of the web application has the highest precedence when resolving conflicts between the web.xml, web-fragment.xml and annotations.
pg 8-79: a. Configuration settings in web fragments are used to augment those specified in the main web.xml in such a way as if they had been specified in the same web.xml.
pg 9-80: g. After the above conflicts have been resolved, these additional rules are applied
i. Elements that may be declared any number of times are additive across the web-fragments in the resulting web.xml. For example, elements with different are additive.
ii. Elements that may be declared any number of times, if specified in the web.xml overrides the values specified in the web-fragments with the
same name.
iii. If an element with a minimum occurrence of zero, and a maximum occurrence of one, is present in a web fragment, and missing in the main
web.xml, the main web.xml inherits the setting from the web fragment. If the element is present in both the main web.xml and the web fragment, the configuration setting in the main web.xml takes precedence. For example, if both the main web.xml and a web fragment declare the same servlet, and the servlet declaration in the web fragment specifies a element, whereas the one in the main web.xml does not, then the element from the web fragment will be used in the merged web.xml.
pg 8-81 v. declarations are additive.
Therefore, what should happen in the following situations:
1. web.xml defines a list of welcome-files and a fragment-web.xml also defines a list of welcome-files. Are the ones from the fragment additive or does web.xml take precedence?
2. the servlet container provides a default set of welcome-files, the web.xml does NOT define any welcome-files, but a fragment-web.xml defines a different list. Should the final list of welcome files contain the union of those defined by the servlet container and the fragment, or only those defined by the fragment.