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
A. doc-rootdd.xml
B. doc-rootweb.xml
C. doc-rootWEB-INFweb.xml
D. doc-rootWEB_INFdd.xml
E. doc-rootWEB-INFdd.xml
F. doc-rootWEB_INFweb.xml
G. doc-rootWEB-INFlibdd.xml
H.doc-rootWEB-INFclassesdd.xml ✔️C
2. 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.
A. aservlet-config
B. init-param
C. load-on-startup
D. filter ✔️B
3. Which of these is true about deployment descriptors. Select the one correct answer.
A. The order of elements in deployment descriptor is not important. The elements can follow any order.
B. The elements of deployment descriptor are case insensitive.
C. The servlet-mapping element, if defined, must be included within the servlet element.
D. The web-app element must include the servlet element. ✔️A
4. 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.
A. error-page
,B. servlet
C. exception
D. error-handling ✔️A
5. Which of these is a correct fragment within the web-app element of deployment descriptor. Select
the one correct answer.
A. <exception> <exception-type> mypackage.MyException</exception-type> <location>
/error.jsp</location> </exception>
B. <error-page> <exception-type> mypackage.MyException</exception-type> <location>
/error.jsp</location> </error-page>
C. <error-page> <exception> mypackage.MyException </exception-type> <location> /error.jsp
</location> </error-page>
D. <error-page> <exception-type> mypackage.MyException</exception-type> </error-page>
F. <error-page> <servlet-name> myservlet</servlet-name> <exception-type>
mypackage.MyException</exception-type> </error-page>
G. <exception> <servlet-name> myservlet</servlet-name> <exception-type>
mypackage.MyException</exception-type> </exception> ✔️B
6. Which element of the deployment descriptor of a web application includes the welcome-file-list
element as a subelement. Select the one correct answer.
A. web-app
B. welcome-file
C. servlet
D. file-list ✔️A
7. Which of these is a correct fragment within the web-app element of deployment descriptor. Select
the two correct answer.
A. <error-page> <error-code>404</error-code> <location>/error.jsp</location> </error-page>
B. <error-page> <exception-type>mypackage.MyException</exception-type> <error-code>404</error-
code> <location>/error.jsp</location> </error-page>
, C. <error-page> <exception-type>mypackage.MyException</exception-type> <error-code>404</error-
code> </error-page>
D. <error-page> <exception-type>mypackage.MyException</exception-type>
<location>/error.jsp</location> </error-page> ✔️AD
8. Which of these is a correct example of specifying a listener element resented by MyClass class.
Assume myServlet element is defined correctly. Select the one correct answer.
A. <listener>MyClass</listener>
B. <listener> <listener-class>MyClass</listener-class></listener>
C. <listener> <listener-name>aListener</listener-name> <listener-class>MyClass</listener-class>
</listener>
D. <listener> <servlet-name>myServlet</servlet-name> <listener-class>MyClass</listener-class>
</listener> ✔️B
9. The root of the deployment descriptor is named as
A. web
B. web-app
C. name
D. display-name ✔️B
10. With in a context-param element of deployment descriptor, which of the following element is
required?
A. param-name
B. name
C. init-param
D. servlet-name ✔️A
11. Which of these is not a valid top level element in web-app
A. icon
B. listener
C. eror-page