对于遵循 servlet 3.0 规范的标准 Java EE 部署描述符元素,您可以处理例如 Oracle 的 Weblogic 12c web.xml 文档。
此外,对于上述文档中未考虑的缺失子元素,我建议您查看web-common_3_0.xsd文件,它是 Servlet 3.0 部署描述符的通用 XML Schema ( ...) 依次由 web.xml 和 web-fragment.xml Web 应用程序的 war 文件使用。
事件虽然会强制您读取 XML,但您可以在此文件中检查所有元素及其子元素,这些元素可在web.xml部署描述符中使用,例如cookie-config
:
<xsd:element name="cookie-config"
type="javaee:cookie-configType"
minOccurs="0">
<xsd:annotation>
<xsd:documentation>
The cookie-config element defines the configuration of the
session tracking cookies created by this web application.
</xsd:documentation>
</xsd:annotation>
</xsd:element>