Search code examples
web.xml

What is web-resource-name in web.xml?


The following are the tags I am using in my web.xml file.

What is web-resource-name?

<security-constraint>
    <web-resource-collection>
        <web-resource-name>profile</web-resource-name>
        <url-pattern>/profile/*</url-pattern>
    </web-resource-collection>
    <user-data-constraint>
        <transport-guarantee>CONFIDENTIAL</transport-guarantee>
    </user-data-constraint>
</security-constraint>

Solution

  • I found a page in the Java EE 6 docs which seems to answer your question, and explains some other tags beside:

    A web resource collection consists of the following subelements:

    • web-resource-name is the name you use for this resource. Its use is optional.