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"?()
A.${map.c}
B.${map[c]}
C.${map["c"]}
D.${map.map.b}
E.${map[map.b]}
您可能感興趣的試卷
你可能感興趣的試題
You are building a dating web site. The client’s date of birth is collected along with lots of other information.You have created an EL function with the signature:
calcAge(java.util.Date):int and it is assigned to the name, age, in the namespace, funct. In one of your JSPsyou need to print a special message to clients who are younger than 25.
Which EL code snippet will returntrue for this condition?()
A.${calcAge(client.birthDate) < 25}
B.${calcAge[client.birthDate] < 25}
C.${funct:age(client.birthDate) < 25}
D.${funct:age[client.birthDate] < 25}
E.${funct:calcAge(client.birthDate) < 25}
You are creating an error page that provides a user-friendly screen whenever a server exception occurs.You want to hide the stack trace, but you do want to provide the exception’s error message to the user sothe user can provide it to the customer service agent at your company.
Which EL code snippet inserts thiserror message into the error page?()
A.Message: <b>${exception.message}</b>
B.Message: <b>${exception.errorMessage}</b>
C.Message: <b>${request.exception.message}</b>
D.Message: <b>${pageContext.exception.message}</b>
E.Message: <b>${request.exception.errorMessage}</b>
Click the Exhibit button.
Given:
11.<% com.example.Advisor advisor = new com.example.Advisor(); %>
12.<% request.setAttribute("foo", advisor); %>
Assuming there are no other "foo" attributes in the web application,which three are valid EL expressions forretrieving the advice property of advisor?()
A.${foo.advice}
B.${request.foo.advice}
C.${requestScope.foo.advice}
D.${requestScope[foo[advice]]}
E.${requestScope["foo"]["advice"]}
Given:
6.<% int[] nums = {42, 420, 4200};
7.request.setAttribute("foo", nums); %>
Which two successfully translate and result in a value of true?()
A.${true or false}
B.${requestScope[foo][0] > 500}
C.${requestScope[’foo’][1] = 420}
D.${(requestScope[’foo’][0] lt 50) && (3 gt 2)}
You are building a Front Controller using a JSP page and you need to determine if the user’s session hasNOT been created yet and perform some special processing for this case.
Which scriptlet code snippet willperform 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} %>
最新試題
Click the ’Select and Place’ button.Place the events in the order they occur.
Which three are true about servlet filters?()
Which is true about the web container request processing model?()
A web browser need NOT always perform a complete request for a particular page that it suspects mightNOT have changed. The HTTP specification provides a mechanism for the browser to retrieve only a partialresponse from the web server; this response includes information, such as the Last-Modified date but NOTthe body of the page.Which HTTP method will the browser use to retrieve such a partial response?()
Click the ’Select and Place’ button.Place the events in the order they occur.
Your IT department is building a lightweight Front Controller servlet that invokes an application logic objectwith the interface:public interface ApplicationController {public String invoke(HttpServletRequest request)}The return value of this method indicates a symbolic name of the next view. From this name, the FrontController servlet looks up the JSP URL in a configuration table. This URL might be an absolute path or apath relative to the current request. Next, the Front Controller servlet must send the request to this JSP togenerate the view. Assume that the servlet variable request is assigned the current HttpServletRequestobject and the variable context is assigned the webapp’s ServletContext.Which code snippet of the FrontController servlet accomplishes this goal?()
The JSP developer wants a comment to be visible in the final output to the browser.Which comment styleneeds to be used in a JSP page?()
Click the ’Select and Place’ button.Place the events in the order they occur.
Given tutorial.jsp:2.EL Tutorial3.Example 14.5.Dear ${my:nickname(user)}6.Which, when added to the web application deployment descriptor,ensures that line 5 is included verbatimin the JSP output?()
All of your JSPs need to have a link that permits users to email the web master. This web application islicensed to many small businesses, each of which have a different email address for the web master. Youhave decided to use a context parameter that you specify in the deployment descriptor, like this:42.<context-param>43.<param-name>webmasterEmail</param-name>44.<param-value>master@example.com</param-value>45.</context-param>Which JSP code snippet creates this email link?()