A developer is designing a web application that must verify for each request:
The originating request is from a trusted network.
The client has a valid session.
The client has been authenticated.
Which design pattern provides a solution in this situation?
A. Transfer Object
B. Session Facade
C. Intercepting Filter
D. Template Method
E. Model-View-Controller
Given the security constraint in a DD:
101.
102.
103.
104.
105.
106.
107.
108.
109.
110.
And given that "MANAGER" is a valid role-name, which four are true for this security constraint? (Choose four.)
A. MANAGER can do a GET on resources in the /Bar/Baz directory.
B. MANAGER can do a POST on any resource in the /Bar/Baz directory.
C. MANAGER can do a TRACE on any resource in the /Bar/Baz directory.
D. DEVELOPER can do a GET on resources in the /Bar/Baz directory.
E. DEVELOPER can do only a POST on resources in the /Bar/Baz directory.
F. DEVELOPER can do a TRACE on any resource in the /Bar/Baz directory.
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)}
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);
Which statement is true about web container session management?
A. Access to session-scoped attributes is guaranteed to be thread-safe by the web container.
B. To activate URL rewriting, the developer must use the HttpServletResponse.setURLRewriting method.
C. If the web application uses HTTPS, then the web container may use the data on the HTTPS request stream to identify the client.
D. The JSESSIONID cookie is stored permanently on the client so that a user may return to the web application and the web container will rejoin that session.
A developer has created a web application that includes a servlet for each use case in the application. These servlets have become rather difficult to maintain because the request processing methods have become very large. There is also common processing code in many servlets because these use cases are very similar. Which two design patterns can be used together to refactor and simplify this web application? (Choose two.)
A. Proxy
B. View Helper
C. Front Controller
D. Session Facade
E. Business Delegate
F. Model-View-Controller
Which method must be used to encode a URL passed as an argument to HttpServletResponse.sendRedirect when using URL rewriting for session tracking?
A. ServletResponse.encodeURL
B. HttpServletResponse.encodeURL
C. ServletResponse.encodeRedirectURL
D. HttpServletResponse.encodeRedirectURL
Which two are valid and equivalent? (Choose two.)
A. <%! int i; %>
B. <%= int i; %>
C.
D.
E.
You are building a dating service web site. Part of the form to submit a client's profile is a group of radio buttons for the person's hobbies:
20.
Hiking
21.
Skiing
22.
SCUBA Diving
23.
After the user submits this form, a confirmation screen is displayed with these hobbies listed. Assume that an application-scoped variable, hobbies, holds a map between the Hobby enumerated type and the display name.
Which EL code snippet will display Nth element of the user's selected hobbies?
A. ${hobbies[hobbyEnum[N]}
B. ${hobbies[paramValues.hobbyEnum[N]]}
C. ${hobbies[paramValues@'hobbyEnum'@N]}
D. ${hobbies.get(paramValues.hobbyEnum[N])}
E. ${hobbies[paramValues.hobbyEnum.get(N)]}
Given a web application in which the request parameter productID contains a product identifier. Which two EL expressions evaluate the value of the productID? (Choose two.)
A. ${productID}
B. ${param.productID}
C. ${params.productID}
D. ${params.productID[1]}
E. ${paramValues.productID}
F. ${paramValues.productID[0]}
G. ${pageContext.request.productID}