單項(xiàng)選擇題

Assume a JavaBean com.example.GradedTestBean exists and has two attributes. The attribute name is oftype java.lang.String and the attribute score is of type java.lang.Integer. An array of com.example.
GradedTestBean objects is exposed to the page in a request- scoped attribute called results. Additionally,an empty java.util.HashMap called resultMap is placed in the page scope. A JSP page needs to add the firstentry in results to resultMap, storing the name attribute of the bean as the key and the score attribute of thebean as the value.
Which code snippet of JSTL code satisfies this requirement?()

A.${resultMap[results[0].name] = results[0].score}
B.<c:set var="${resultMap}" key="${results[0].name}" value="${results[0].score}" />
C.<c:set var="resultMap" property="${results[0].name}"> ${results[0].value}</c:set>
D.<c:set var="resultMap" property="${results[0].name}" value="${results[0].score}" />
E.<c:set target="${resultMap}" property="${results[0].name}" value="${results[0].score}" />


您可能感興趣的試卷

你可能感興趣的試題

1.多項(xiàng)選擇題Which two are true about the JSTL core iteration custom tags?()

A.It may iterate over arrays, collections, maps, and strings.
B.The body of the tag may contain EL code, but not scripting code.
C.When looping over collections, a loop status object may be used in the tag body.
D.It may iterate over a map, but only the key of the mapping may be used in the tag body.
E.When looping over integers (for example begin=’1’ end=’10’), a loop status object may not be used inthe tag body.

2.單項(xiàng)選擇題

Click the Exhibit button.

Assuming the tag library in the exhibit is imported with the prefix stock,which custom tag invocation outputsthe contents of the variable exposed by the quote tag?()

A.<;stock:quote&ensp;symbol=";SUNW";&ensp;/>;${var}
B.${var}.&ensp;<;stock:quote&ensp;symbol=";SUNW";&ensp;/>;
C.<;stock:quote&ensp;symbol=";SUNW";>;.&ensp;${var}.&ensp;<;/stock:quote>;
D.<;stock:quote&ensp;symbol=";SUNW";&ensp;var=";quote";&ensp;/>;${quote}

3.單項(xiàng)選擇題

A JSP page contains a taglib directive whose uri attribute has the value dbtags.
Which XML element withinthe web application deployment descriptor defines the associated TLD?()

A.<tld><uri>dbtags</uri><location>/WEB-INF/tlds/dbtags.tld</location></tld>
B.<taglib><uri>dbtags</uri><location>/WEB-INF/tlds/dbtags.tld</location>. </taglib>
C.<tld>. <tld-uri>dbtags</tld-uri>. <tld-location>/WEB-INF/tlds/dbtags.tld</tld-location> . </tld>
D.<taglib><taglib-uri>dbtags</taglib-uri><taglib-location>/WEB-INF/tlds/dbtags.tld. </taglib-location>. </taglib>

4.單項(xiàng)選擇題

Assume the custom tag my:errorProne always throws a java.lang.RuntimeException with the message "Filenot found." An error page has been configured for this JSP page.
Which option prevents the exceptionthrown by my:errorProne from invoking the error page mechanism, and outputs the message "File notfound" in the response?()

A.<c:try catch="ex"><my:errorProne /></c:try>${ex.message}
B.<c:catch var="ex"><my:errorProne /></c:catch>${ex.message}
C.<c:try>. <my:errorProne />. </c:try>. <c:catch var="ex" />. ${ex.message}
D.<c:try>. <my:errorProne />. <c:catch var="ex" />. ${ex.message}. </c:try>

5.多項(xiàng)選擇題

You are writing a JSP that includes scriptlet code to declare a List variable and initializes that variable to anArrayList object.
Which two JSP code snippets can you use to import these list types?()

A.<%! import java.util.*; %>
B.<%! import java.util.List;import java.util.ArrayList; %>
C.<%@ page import=’java.util.List’import=’java.util.ArrayList’ %>
D.<%@ import types=’java.util.List’types=’java.util.ArrayList’ %>
E.<%@ page import=’java.util.List,java.util.ArrayList’ %>
F.<%@ import types=’java.util.List,java.util.ArrayList’ %>

最新試題

Click the ’Select and Place’ button.Place the events in the order they occur.

題型:?jiǎn)柎痤}

Given a web application in which the request parameter productID contains a product identifier.Which twoEL expressions evaluate the value of the productID?()

題型:多項(xiàng)選擇題

Click the 'Select and Place' button.Place the events in the order they occur.

題型:?jiǎn)柎痤}

Click the ’Select and Place’ button.Place the events in the order they occur.

題型:?jiǎn)柎痤}

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?()

題型:?jiǎn)雾?xiàng)選擇題

Which two are valid and equivalent?()

題型:多項(xiàng)選擇題

Which is true about the web container request processing model?()

題型:?jiǎn)雾?xiàng)選擇題

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?()

題型:?jiǎn)雾?xiàng)選擇題

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?()

題型:?jiǎn)雾?xiàng)選擇題

Which is a benefit of precompiling a JSP page?()

題型:?jiǎn)雾?xiàng)選擇題