单选题 Assume a tag handler extends TagSupport. Which is used within the tag handler to get an attribute “foo” that is in the application scope?()
pageContext.getAttribute(“foo”);
getPageContext().getAttribute(“foo”);
pageContext.getApplicationScope(“foo”);
pageContext.getAttribute(“foo”,pageContext.APPLICATION_SCOPE).getAttribute(“foo”);
getPageContext().getScope(pageContext.APPLICATION_SCOPE).getAttribute(“foo”);
单选题 Which EL expression, inserted at line 3 is valid and evaluated to “beanValue”?()
${bean}
${value}
${beanValue}
${com.example.bean}
${requestScope[“com.example.bean”]}
${request.get(“com.example.bean”).toString()}
单选题 The attribute “name” has a value of “Foo,” What is the result if this tag handler’s tag is invoked?()
Foo
done
Foodone
An exception is thrown at runtime.
Compilation fails because of an error in this code.
多选题 Which the two are true about the JSTL core iteration custom tags?()
It may iterate over arrays, collections, maps and strings.
The body of the tag may contain EL code, but not scripting code.
When looping over collections, a loop status object may be used in the tag body.
It may iterate over a map, but only the key of the mapping may be used in the tag body.
When looping over integers (for example begin1=’1’ end=’10’), a loop status object may not be used in the tag body.
单选题 What is the result?()
The code compiles and “s=” is printed.
The code compiles and “s=” + s);
The code does not compile because Strings is not initialized.
The code does not compile because Strings cannot be referneed.
The code comiles, but a NullPointer Exception is thrown when toString is called.
单选题 What is the result?()
An exception is thrown.
The code does not compile.
“Hello worlds.” Is printed to the terminal.
The program exits without printing anything.
多选题 Given that a scoped attribute cart exist only in a user’s session, which two, taken independently, ensure the scoped attribute cart no longer exists?()
${cart = null }
<c:remove var=”cart” />
<c:remove var=”${cart}” />
<c:remove var=”cart” scope=”session” />
<c:remove scope=”session”>cart</c:remove>
<c:remove var=”${cart}” scope=”session” />
<c:remove scope=”session”>${cart}</c:remove>
多选题 Which two choices are equivalent?()
16 > 4
16 / 2
16 * 4
16 >> 2
16 / 22
16 >>> 2
单选题 To implement the design intent, which statement must be inserted at line 42?()
session = response.getSession();
session = request.getSession();
session = request.getSession(true);
session = request.getSession(false);
session = request.getSession(“jsessionid”);