欢迎来到PP题库网 PP题库官网
logo
全部科目 > Java认证考试 > SCWCD(310-083)

单项选择题

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<String> 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);

点击查看答案

相关考题

微信小程序免费搜题
微信扫一扫,加关注免费搜题

微信扫一扫,加关注免费搜题