试题详情
- 单项选择题 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)
- D
关注下方微信公众号,在线模考后查看
热门试题
- 下面是有关子类调用父类构造函数的描述正确
- public void&en
- A developer
- 下面哪种情况会导致持久区jvm堆内存溢出
- public class&e
- // Point
- Given this&ens
- 如果想要一个类不能被任何类继承的话,需要
- 以下变量类型中,不属于简单变量类型的是(
- this()表示()
- 假设有2个整数x和y,表达式x>=y
- Given classes&e
- public class&e
- public class&e
- 打印出所有的"水仙花数",所谓"水仙花数
- public class&e
- 11. static&ens
- 往OuterClass类的代码段中插入内
- Click the
- 创建线程的时候必须实现哪项接口?()