tomcat7 - java, tomcat: what is the meaning of the id attribute in the tag web-app in web.xml? -


what meaning of web.xml id attribute of web-app tag?

eclipse generated id="webapp_id". using version servlet specification version 2.5, switched using 3.0, suggestion of this answer doesn't include id.

is necessary? value supposed be?

the newer versions of servlet spec use .xsd files no further information on id attribute, if go older versions .dtd, such web_app_2_2.dtd, find:

the id mechanism allow tools make tool-specific references elements of deployment descriptor. allows tools produce additional deployment information (i.e information beyond standard deployment descriptor information) store non-standard information in separate file, , refer these tools-specific files information in standard web-app deployment descriptor.

for example, websphere application server used id mechanism in old bnd , ext files:

web.xml: <web-app id="webapp_id" ...  ibm-web-app-bnd.xmi: <webappbnd:webappbinding ...   <webapp href="web-inf/web.xml#webapp_id"/> 

(thankfully, tool-friendly-but-developer-annoying use of id attributes no longer necessary newer .xml file format ibm-web-bnd/ext, digress.)


Comments

Popular posts from this blog

c# - how to write client side events functions for the combobox items -

exception - Python, pyPdf OCR error: pyPdf.utils.PdfReadError: EOF marker not found -