One of the use cases in your web application uses many session-scoped attributes. At the end of the use case, you want to clear out this set of attributes from the session object. Assume that this static variable holds this set of attribute names:
201.
private static final Set
202.
static {
203.
USE_CASE_ATTRS.add("customerOID");
204.
USE_CASE_ATTRS.add("custMgrBean");
205.
USE_CASE_ATTRS.add("orderOID");
206.
USE_CASE_ATTRS.add("orderMgrBean");
207.
}
Which code snippet deletes these attributes from the session object?
A. session.removeAll(USE_CASE_ATTRS);
B. for ( String attr : USE_CASE_ATTRS ) {session.remove(attr);}
C. for ( String attr : USE_CASE_ATTRS ) {session.removeAttribute(attr);}
D. for ( String attr : USE_CASE_ATTRS ) {session.deleteAttribute(attr);}
E. session.deleteAllAttributes(USE_CASE_ATTRS);
Your management has required that all JSPs be created to generate XHTML-compliant content and to facilitate that decision, you are required to create all JSPs using the JSP Document format. In the reviewOrder.jspx page, you need to use several core JSTL tags to process the collection of order items in the customer's shopping cart. Which JSP code snippets must you use in the reviewOrder.jspx page?
A.
B.
C.
D.
hich two are true regarding a web application class loader? (Choose two.)
A. A web application may override the web container's implementation classes.
B. A web application running in a J2EE product may override classes in the javax.* namespace.
C. A web application class loader may NOT override any classes in the java.* and javax.* namespaces.
D. Resources in the WAR class directory or in any of the JAR files within the library directory may be accessed using the J2SE semantics of getResource.
E. Resources in the WAR class directory or in any of the JAR files within the library directory CANNOT be accessed using the J2SE semantics of getResource.
For debugging purposes, you need to record how many times a given JSP is invoked before the user's session has been created. The JSP's destroy method stores this information to a database. Which JSP code snippet keeps track of this count for the lifetime of the JSP page?
A. <%! int count = 0; %><% if ( request.getSession(false) == null ) count++; %>
B. <%@ int count = 0; %><% if ( request.getSession(false) == null ) count++; %>
C. <% int count = 0;if ( request.getSession(false) == null ) count++; %>
D. <%@ int count = 0;if ( request.getSession(false) == null ) count++; %>
E. <%! int count = 0;if ( request.getSession(false) == null ) count++; %>
Your web application views all have the same header, which includes the
10.
Which JSP code snippet should you use in your main view JSPs to insert the header and pass the pageTitle variable?
A.
B.
C.
D.
E.
For manageability purposes, you have been told to add a "count" instance variable to a critical JSP Document so that a JMX MBean can track how frequent this JSP is being invoked. Which JSP code snippet must you use to declare this instance variable in the JSP Document?
A.
B. <%! int count = 0; %>
C.
D.
You are building a Front Controller using a JSP page and you need to determine if the user's session has NOT been created yet and perform some special processing for this case. Which scriptlet code snippet will perform this test?
A. <% if ( request.getSession(false) == null ) {// special processing} %>
B. <% if ( request.getHttpSession(false) == null ) {// special processing} %>
C. <% if ( requestObject.getSession(false) == null ) {// special processing} %>
D. <% if ( requestObject.getHttpSession(false) == null ) {// special processing} %>
Given:
11.
<% java.util.Map map = new java.util.HashMap();
12.
request.setAttribute("map", map);
13.
map.put("a", "b");
14.
map.put("b", "c");
15.
map.put("c", "d"); %>
16.
<%-- insert code here --%>
Which three EL expressions, inserted at line 16, are valid and evaluate to "d"? (Choose three.)
A. ${map.c}
B. ${map[c]}
C. ${map["c"]}
D. ${map.map.b}
E. ${map[map.b]}
F. ${map.(map.b)}
Which two are characteristics of the Front Controller pattern? (Choose two.)
A. It simplifies remote interfaces to distributed objects.
B. It promotes cleaner application partitioning and encourages reuse.
C. It provides an initial point of contact for handling all related requests.
D. It reduces maintainability due to the increased complexity of the design.
E. It provides loosely coupled handlers that can be combined in various permutations.
A web application allows the HTML title banner to be set using a servlet context initialization parameter called titleStr. Which two properly set the title in this scenario? (Choose two.)
A.
B.
C.
D.
E.
F.
G.