网友您好, 请在下方输入框内输入要搜索的题目:
GiventheJSPcode:<%request.setAttribute("foo","bar");%>andtheClassictaghandlercode:5.publicintdoStartTag()throwsJspException{6.//insertcodehere7.//returnint8.}Assumetherearenoother"foo"attributesinthewebapplication.WhichinvocationonthepageContextobject,insertedatline6,assigns"bar"tothevariablex?()
A.Stringx=(String)pageContext.getAttribute("foo")
B.Stringx=(String)pageContext.getRequestScope("foo")
C.ItisNOTpossibletoaccessthepageContextobjectfromwithindoStartTag
D.Stringx=(String)pageContext.getRequest().getAttribute("foo")
E.Stringx=(String)pageContext.getAttribute("foo",PageContext.ANY_SCOPE)
参考答案