Name

<web-resource-collection>

Synopsis

<!ELEMENT web-resource-collection (web-resource-name, description?,
                                   url-pattern*, http-method*)>

Description

The <web-resource-collection> element is used to identify a subset of the resources and HTTP methods on those resources within a web application to which a security constraint applies. If no HTTP methods are specified, the security constraint applies to all HTTP methods.

<security-constraint>
    <web-resource-collection>
        <web-resource-name>SecretProtection</web-resource-name>
        <url-pattern>/servlet/SalaryServer</url-pattern>
        <url-pattern>/servlet/secret</url-pattern>
        <http-method>GET</http-method>
        <http-method>POST</http-method>
    </web-resource-collection>
</security-constraint>

Get Java Servlet Programming, 2nd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.