What would happen if I have multiple web-fragments which declare resource-ref
s with the same res-ref-name
in case of:
resource-ref
s have the same res-type
resource-ref
s have different res-type
Also what would happen if there is a resource-ref
with the same res-ref-name
in the web.xml
in case of:
resource-ref
s have the same res-type
resource-ref
s have different res-type
I'm looking for what the specs are saying and not "try it to find out".
The Java Servlet Specification Version 3.1 has the following to say in §8.2.1:
The requirements about name uniqueness that exist currently for a single web.xml also apply to the union of a web.xml and all applicable web-fragment.xml files.
and §14.4 says:
The res-ref-name specifies the name of a resource manager connection factory reference. The name is a JNDI name relative to the java:comp/env context. The name must be unique within a deployment file.
Therefore your application should fail to deploy.