可学答题网 > 问答 > SCWCD(310-083)题库
目录: 标题| 题干| 答案| 搜索| 相关
问题

Given the JSP code: &l


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

  • AString x = (String) pageContext.getAttribute("foo")
  • BString x = (String) pageContext.getRequestScope("foo")
  • CIt is NOT possible to access the pageContext object from within doStartTag
  • DString x = (String) pageContext.getRequest().getAttribute("foo")
  • EString x = (String) pageContext.getAttribute("foo", PageContext.ANY_SCOPE)
参考答案
参考解析:
分类:SCWCD(310-083)题库