nerdexam
Oracle

1Z0-899 · Question #181

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…

The correct answer is B. Create an HttpSessionAttributeListener class and implement the attributeRemoved method and log the. See the full explanation below for the reasoning.

Question

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. Which listener class will accomplish this debugging goal?

Options

  • ACreate an HttpSessionAttributeListener class and implement the attributeDeleted method and log the
  • BCreate an HttpSessionAttributeListener class and implement the attributeRemoved method and log the
  • CCreate an SessionAttributeListener class and implement the attributeRemoved method and log the
  • DCreate an SessionAttributeListener class and implement the attributeDeleted method and log the

How the community answered

(38 responses)
  • A
    11% (4)
  • B
    82% (31)
  • C
    3% (1)
  • D
    5% (2)

Community Discussion

No community discussion yet for this question.

Full 1Z0-899 Practice