<security-constraint>
<web-resource-collection>
<web-resource-name>AccountServlet</web-resource-name>
<description>This is an Account Servlet.</description>
<http-method>GET</http-method>
<http-method>POST</http-method>
<http-method>PUT</http-method>
<http-method>DELETE</http-method>
<url-pattern>acme/AccountServlet</url-pattern>
</web-resource-collection>
</security-constraint>
It is not possible to define more than two http method in the web-resource-collection element.
B: The delete http method is not allowed in the http-method element declaration.
C: It is necessary that the web-resource-name must be specified in the web-resource-collection element.
D: It is necessary that the web-resource-name must be specified in the url of the url-pattern element.
E: If no http-method is specified in the web-resource-collection element, the security restriction will be applied to all http methods.
F: There should be at-least one url-pattern element otherwise, the
Explanation: Answer options C, E, and F are correct.
If no http-method is specified in the web-resource-collection element, the security restriction will be applied to all http methods. There should be at-least one url-pattern element otherwise, the <web-resource-collection> will be ignored.
Responses to “Which of the following statements are correct about the code given below?”