Given the JSP code:
<% request.setAttribute("foo", "bar"); %>and the Classic tag handler code:
5. public int doStartTag() throws JspException {
6. // insert code here
7. // return int
8. }
Assume there are no other "foo" attributes in the web application.
Which invocation on the pageContextobject,inserted at line 6,assigns "bar" to the variable x?()
A.String x = (String) pageContext.getAttribute("foo")
B.String x = (String) pageContext.getRequestScope("foo")
C.It is NOT possible to access the pageContext object from within doStartTag
D.String x = (String) pageContext.getRequest().getAttribute("foo")
E.String x = (String) pageContext.getAttribute("foo", PageContext.ANY_SCOPE)
您可能感興趣的試卷
你可能感興趣的試題
Click the Exhibit button.
The attribute "name" has a value of "Foo,"
What is the result if this tag handler’s tag is invoked?()
A.Foo
B.done
C.Foodone
D.An exception is thrown at runtime
E.No output is produced from this code
F.Compilation fails because of an error in this code
You have created a JSP that includes instance variables and a great deal of scriptlet code. Unfortunately,after extensive load testing, you have discovered several race conditions in your JSP scriptlet code. To fixthese problems would require significant recoding, but you are already behind schedule.
Which JSP codesnippet can you use to resolve these concurrency problems?()
A.<%@ page isThreadSafe=’false’ %>
B.<%@ implements SingleThreadModel %>
C.<%! implements SingleThreadModel %>
D.<%@ page useSingleThreadModel=’true’ %>
E.<%@ page implements=’SingleThreadModel’ %>
A.Config
B.Request
C.Session
D.Application
最新試題
Which is true about the web container request processing model?()
Click the ’Select and Place’ button.Place the events in the order they occur.
Click the ’Select and Place’ button.Place the events in the order they occur.
You need to create a JSP that generates some JavaScript code to populate an array of strings used on the client-side.Which JSP code snippet will create this array?()
Which ensures that a JSP response is of type "text/plain"?()
Click the ’Select and Place’ button.Place the events in the order they occur.
Click the ’Select and Place’ button.Place the events in the order they occur.
Which three are true about servlet filters?()
Click the ’Select and Place’ button.Place the events in the order they occur.
Which is a benefit of precompiling a JSP page?()