READ Free Dumps For Oracle- 1z0-899
Question ID 4707 | Given the definition of Myobject and that an instance of Myobject is bound as a session attribute: |
Option A | A. Only a single instance of Myobject may exist within a session |
Option B | B. The unbound method of the Myobject instance is called when the session to which it is bound times out |
Option C | C. The com.example.MyObject must be declared as a servlet event listener in the web application deployment descriptor |
Option D | D. The valueUnbound method of the Myobject instance is called when the session to which it is bound times out |
Correct Answer | D |
Question ID 4708 | Your web application requires the adding and deleting of many session attributes during a complex use case. A bug report has come in that indicates that an important session attribute is being deleted too soon and a NullPointerException is being thrown several interactions after the fact. You have decided to create a session event listener that will log when attributes are being deleted so you can track down when the attribute is erroneously being deleted. |
Option A | A. Create an HttpSessionAttributeListener class and implement the attributeDeleted method and log the attribute name using the getName method on the event object. |
Option B | B. Create an HttpSessionAttributeListener class and implement the attributeRemoved method and log the attribute name using the getName method on the event object. |
Option C | C. Create an SessionAttributeListener class and implement the attributeRemoved method and log the attribute name using the getAttributeName method on the event object. |
Option D | D. Create an SessionAttributeListener class and implement the attributeDeleted method and log the attribute name using the getAttributeName method on the event object. |
Correct Answer | B |