JavaRocks

SCWCD

Question 16

Which element of the deployment descriptor includes the exception-type as a sub-element ?  
 
     A    <exception>       
     B    <error-page>       
     C    <error>       
     D    <exception_type>       
     E    <error_page>   

Answer
B

Question 17

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>    

Answer
A and D

Question 18

Which element of the deployment descriptor of a web application includes the welcome-file-list element as a sub element.
   
     A    <welcome>       
     B    <welcome-files>       
     C    <list>       
     D    <web-app>       
     E    <context>   

Answer
D

Question 19

Which of these is a correct example of specifying a listener element resented by MyClass class. Assume myServlet element is defined correctly. Select 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>   

Answer
B

Question 20

Which of the following is legal JSP syntax to print the value of i. Select the one correct answer  
 
     A    <<%int i = 1;%>
<%= i; %>        
     B    <%int i = 1;
i; %>       
     C    <%int i = 1%>
<%= i %>       
     D    <%int i = 1;%>
<%= i %>        
     E    <%int i = 1%>
<%= i; %>

Answer
D

Previous        Next