试题详情
- 单项选择题
One of the use cases in your web application uses many session-scoped attributes. At the end of the usecase,you want to clear out this set of attributes from the session object. Assume that this static variableholds this set of attribute names: 201.private static final Set USE_CASE_ATTRS; 202.static { 203.USE_CASE_ATTRS.add("customerOID"); 204.USE_CASE_ATTRS.add("custMgrBean"); 205.USE_CASE_ATTRS.add("orderOID"); 206.USE_CASE_ATTRS.add("orderMgrBean"); 207.} Which code snippet deletes these attributes from the session object?() A、session.removeAll(USE_CASE_ATTRS);
B、for ( String attr : USE_CASE_ATTRS ) {session.remove(attr);}
C、for ( String attr : USE_CASE_ATTRS ) {session.removeAttribute(attr);}
D、for ( String attr : USE_CASE_ATTRS ) {session.deleteAttribute(attr);}
E、session.deleteAllAttributes(USE_CASE_ATTRS);
- C
关注下方微信公众号,在线模考后查看
热门试题
- Which two̳
- 如果不使用布局管理器,会出现哪些问题?(
- 11. public
- Which statemen
- 下面的代码运行的结果是:()。
- import java.io
- 现有: class&ens
- 求解“鸡兔同笼问题”:鸡和兔在一个笼里,
- 已知: 要使程序正确编译需要在横线处添
- 下面哪个不对()。
- String类的concat()方法与S
- You have
- 如何定义继承关系?为“学生”类派生出“小
- 一个整数,它加上100后是一个完全平方数
- 以下关于异常捕获的原则中,错误的是()
-
A web& - A developer&en
- public class&
- 在try的括号里面有return一个值,
- 一个数如果恰好等于它的因子之和,这个数就