SCJP Certification

Sun Certified Java Programmer Certification exam essentials

May 26th, 2010

Which of the following statements are correct about the code given below?

Uncategorized, by Daisy Williams.

<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 will be ignored.

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.

Share

Back Top

Responses to “Which of the following statements are correct about the code given below?”

Comments (0) Trackbacks (0) Leave a comment Trackback url
  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Your email address will not be published. Required fields are marked *

*