问题
Is there a full documentaion of the deployment descriptor that describes each element and each sub-element? I realy can't find it.
P.S. I ask because I found the way to set maxAge of session cookies by adding
<session-config>
<session-timeout>525600</session-timeout>
<cookie-config>
<max-age>31536000</max-age>
</cookie-config>
</session-config>
into DD. But I cannot find any official documentation that describes <cookie-config>
element.
回答1:
For the standard Java EE deployment descriptor elements, that follows the servlet 3.0 specification, you can address, for instance, Oracle's Weblogic 12c web.xml docs.
Furthermore, for the missing sub-elements that aren't contemplated in the documentation mentioned above, I'd suggest you to give a look to the web-common_3_0.xsd file, which is the common XML Schema for the Servlet 3.0 deployment descriptor (...) in turn used by web.xml and web-fragment.xml web application's war file.
Event though it will force you to read XML, in this file you may check all the elements, as well as their sub-elements, that can be used in web.xml deployment descriptor as, for instance, the 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>
来源:https://stackoverflow.com/questions/35807976/where-can-i-find-the-full-documentation-of-deployment-descriptorweb-xml