SCWCD : The Structure and Deployment of Web Applications Mock Exam Practice Questions
Questions no -1
Can a jsp-file element present insted of servlet-class within a servlet element?
options
A)jsp-file element can be present insted of servlet-class. and jsp file can be declared.
B)No can't use jsp-file insted of servlet-class.
C)jsp can't use in web.xml insted of servlet.
D)None of the above
Correct answer is : A
Explanations : The servlet is used to declare a servlet. It contains the declarative data of a servlet. The jsp-file element contains the full path to a JSP file within the web application beginning with a "/".
If a jsp-file is specified and the load-on-startup element is present, then the JSP should be precompiled and loaded.
Questions no -2
Any requests from the client to access the resources in WEB-INF/ directory MUST be returned with a ________ ?
options
A)SC_NOT_FOUND
B)SC_INTERNAL_SERVER_ERROR
C)ESC_BAD_REQUEST
D)BAD_REQUEST
Correct answer is : A
Explanations : Any requests from the client to access the resources in WEB-INF/ directory MUST be returned with a SC_NOT_FOUND (404) response.
Questions no -3
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?
options
A)error-page
B)error-path
C)exception-page
D)exception-page-info
Correct answer is : A
Explanations : The element error-page includes the element web-app. This is the page execute when any exception occurs.
|