You are working on a JSP that is intended to inform users about critical errors in the system. The JSP code is attempting to access the exception that represents
the cause of the problem, but your IDE is telling you that the variable does not exist. What should you do to address this problem?
All of your JSPs need to have a link that permits users to email the web master. This web application is licensed to many small businesses, each of which have a
different email address for the web master. You have decided to use a context parameter that you specify in the deployment descriptor, like this:
42.
43. webmasterEmail
44. master@example.com
45.
Which JSP code snippet creates this email link?
A web application for business expense reporting allows uploading expense receipts. Multiple receipts can be uploaded single step using one HTTP request. The
servlet that processes the request has been marked with the @MultipartConfig annotation.
Which method should the servlet use to access the uploaded files?
Given a war file with the following structure
| - WEB-INF/classes/Myservlet.class
| - WEB-INF/lib/wf.jaf
Where wf.jar contains a valid web-fragment.xml and the following two classes: MyFilter1.class and MyFiler2.class.
The web-fragment.xml is as follows:
The following are some code snippets:
When one access "/" of the above web application, which filters will be executed?
Servlet A forwarded a request to servlet B using the forward method of RequestDispatcher. What attribute in B's request object contains the URI of the original
request received by servlet A?
Your web application requires the adding and deleting of many session attributes during a complex use case. A bug report has come in that indicates that an
important session attribute is being deleted too soon and a NullPointerException is being thrown several interactions after the fact. You have decided to create a
session event listener that will log when attributes are being deleted so you can track down when the attribute is erroneously being deleted.
Which listener class will accomplish this debugging goal?
Given the java code snippet in contextInitialized method of a ServletContextListner:
ServletRegistration.Dynamic sr = (ServletRegistration.Dynamic)sc.addServlet
("myServlet", myServletClass);
sr.addMapping("/abc");
sr.setServletSecurityElement(servletSecurityElement);
sr.addMapping("/def");
Which statement is true?