Which of these is true about deployment descriptors. Select the one correct answer.

  1. The order of elements in deployment descriptor is not important. The elements can follow any order.

  2. The elements of deployment descriptor are case insensitive.

  3. The servlet-mapping element, if defined, must be included within the servlet element.

  4. The web-app element must include the servlet element.


Correct Option: A

AI Explanation

To answer this question, let's go through each option to understand why it is correct or incorrect:

Option A) The order of elements in the deployment descriptor is not important. The elements can follow any order. - This option is correct. In a deployment descriptor, such as the web.xml file used in Java web applications, the order of elements is not important. The elements can be placed in any order within the descriptor.

Option B) The elements of the deployment descriptor are case insensitive. - This option is incorrect. The elements in the deployment descriptor are case sensitive. The exact casing, including uppercase and lowercase letters, must be used when defining the elements.

Option C) The servlet-mapping element, if defined, must be included within the servlet element. - This option is incorrect. The servlet-mapping element is defined separately from the servlet element in the deployment descriptor. It is used to map a servlet to a URL pattern.

Option D) The web-app element must include the servlet element. - This option is incorrect. The web-app element is the root element of the deployment descriptor and does not necessarily have to include the servlet element. The servlet element is used to define a servlet within the web-app element, but it is not mandatory.

The correct answer is A) The order of elements in the deployment descriptor is not important. The elements can follow any order. This option is correct because the order of elements in the deployment descriptor is indeed not important, and they can be placed in any order within the descriptor.

Find more quizzes: