Which code snippet deletes these attributes from the session object?

One of the use cases in your web application uses many session-scoped attributes. At the end of the use case, you want to clear out this set of attributes from the session object. Assume that this static variable holds this set of attribute names:
private static final Set<String> USE_CASE_ATTRS;
static {
USE_CASE_ATTRS.add("customerOID");
USE_CASE_ATTRS.add("custMgrBean");
USE_CASE_ATTRS.add("orderOID");
USE_CASE_ATTRS.add("orderMgrBean");
}
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);

Download Printable PDF. VALID exam to help you PASS.

Leave a Reply

Your email address will not be published. Required fields are marked *


The reCAPTCHA verification period has expired. Please reload the page.