Oracle
1Z0-899 · Question #14
A method call inside your servlet has thrown an IOException resulting from a lost network connection to a necessary resource. The servlet has determined that it will be unable to operate…
The correct answer is C. The servlet should throw an unavailableException to the web container. 2.3.3.2, first paragraph)
Advanced Topics
Question
A method call inside your servlet has thrown an IOException resulting from a lost network connection to a necessary resource. The servlet has determined that it will be unable to operate successfully fen few minutes, but expects to be able to resume operation after that period. How should this situation handled?
Options
- AThe servlet should re-throw the exception to the web container.
- BThe servlet should throw a servletException to the web container.
- CThe servlet should throw an unavailableException to the web container.
- DThe servlet should redirect to an error page that reports the exception message.
- EThe servlet should retry the request until the method returns successfully.
How the community answered
(24 responses)- A4% (1)
- B4% (1)
- C79% (19)
- D13% (3)
Explanation
2.3.3.2, first paragraph)
Topics
#UnavailableException#servlet lifecycle#exception handling#temporary unavailability
Community Discussion
No community discussion yet for this question.