Tag: programming languages

Questions Related to programming languages

  1. DISP=OLD,DELETE,KEEP

  2. DISP=OLD,KEEP,KEEP

  3. DISP=NEW,DELETE,DELETE

  4. DISP=SHR,KEEP,DELETE


Correct Option: C

Which of the following files is the correct name and location of deployment descriptor of a web application. Assume that the web application is rooted at \doc-root. Select the one correct answer

  1. \doc-root\dd.xml

  2. \doc-root\web.xml

  3. \doc-root\WEB-INF\web.xml

  4. \doc-root\WEB_INF\dd.xml


Correct Option: C
Explanation:

To solve this question, the user needs to know the naming convention and location of the deployment descriptor for a web application.

The deployment descriptor is an XML file that contains information about the web application, such as the servlets, filters, and other components that make up the application. It is used by the web server or servlet container to configure the application at runtime.

Now, let's go through each option and explain why it is right or wrong:

A. \doc-root\dd.xml: This option is incorrect because the deployment descriptor must be located in the WEB-INF directory of the web application. Therefore, option A is not a valid location for the deployment descriptor.

B. \doc-root\web.xml: This option is incorrect because the deployment descriptor must be located in the WEB-INF directory of the web application. Therefore, option B is not a valid location for the deployment descriptor.

C. \doc-root\WEB-INF\web.xml: This option is correct. This is the correct location and naming convention for the deployment descriptor of a web application. The WEB-INF directory is a special directory that is not directly accessible from the web, so it is a secure location to store configuration files.

D. \doc-root\WEB_INF\dd.xml: This option is incorrect because the deployment descriptor must be named "web.xml" and it must be located in the WEB-INF directory of the web application. Therefore, option D is not a valid location or naming convention for the deployment descriptor.

The Answer is: C

Which element of the servlet element in the deployment descriptor is used to specify the parameters for the ServletConfig object. Select the one correct answer.

  1. servlet-config

  2. init-param

  3. load-on-startup

  4. filter


Correct Option: B

What the JES will do?

  1. Checks for errors

  2. Schedules the job

  3. Manages the output processing of the job.

  4. All the above

  5. None of the above


Correct Option: D

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.

Which one denotes the end of the JOB?

  1. //

  2. //*

  3. /*

  4. END

  5. NONE


Correct Option: A

The exception-type element specifies an exception type and is used to handle exceptions generated from a servlet. Which element of the deployment descriptor includes the exception-type as a sub-element. Select the one correct answer.

  1. error-page

  2. servlet

  3. exception

  4. error-handling


Correct Option: A

What is the Normal DISP position for temporary files?

  1. OLD

  2. PASS

  3. MOD

  4. SHR


Correct Option: B

Which of these is a correct fragment within the web-app element of deployment descriptor. Select the one correct answer. d

  1. mypackage.MyException /error.jsp

  2. mypackage.MyException /error.jsp

  3. mypackage.MyException /error.jsp

  4. mypackage.MyException


Correct Option: B