Given the fragment from Java EE deployment descriptor: 341. <error-page> 342. <exception-type>java.lang.Throwable</exception-type> 343. <location>/mainError.jsp</location> 344. </error-page> 345. <error-page> 346. <exception-type>java.lang.ClassCastException</exception-type> 347. <location>/castError.jsp</location> 348. </error-page> If the web application associated with the fragment above throws a ClassCastException. Which statement is true?…

You have built a web application that you license to small businesses. The webapp uses a context parameter, called licenseExtension, which enables certain advanced features based on your client’s license package. When a client pays for a specific service, you…

Which of following annotations can be used in a servlet class? (i) @javax.annotation.Resource (ii) @javax.annotation.PreDestroy (iii) @javax.annotation.security.RunAs (iv) @javax.annotation.security.RolesAllowed (v) @javax.servlet.annotation.WebServlet A. (v) only B. (i) and (v) C. (i), (ii), (iii) and (v) D. (i), (ii), (iv) and (v)…

Given the portion of a valid Java EE web application’s directory structure: You want to know whether File1.html, File2.html, and/or File3.html is protected from direct access by your web client’s browsers. What statement is true? A. All three files are…

Given this fragment in a servlet: 23. if(reg.isUserInRole(“Admin”)) { 24. // do stuff 25. } And the following fragment from the related Java EE deployment descriptor: 812. <security-role-ref> 813. <role-name>Admin</role-name> 814. <role-link>Administrator</role-link> 815. </security-role-ref> 900. <security-role> 901. <role-name>Admin</role-name> 902. <role-name>Administrator</role-name>…

Which java code snippet checks whether the user is of the role “MANAGER” for a given HttpServRequest, httpServletRequest? A. httpServletRequest.isUserInRole(“MANAGER”); B. httpServletRequest.isCallerInRole(“MANAGER”); C. httpServletRequest.isPrincipalInRole(“MANAGER”); D. httpServletRequest.isAuthnticatedUserInRole(“MANAGER”);