Sun™ Certification Training Guide (310-080): Java™ 2 Enterprise Edition (J2EE™) Web Component Developer Exam
by Alain Trottier
Chapter 5. Servlet Exceptions
OBJECTIVES
Servicing requests from users on the Web means you will sometimes receive bad information. Also, you may make a mistake in your code. How do you handle these conditions in servlets? This chapter discusses error and exception handling.
There are two categories of problems you will face. One is from Java itself and your code. For example, you may try to write a note to the log file, but that file is locked at the moment so the write attempt fails. That will throw an exception. The other category regards the user's request, where you might get a corrupt or incomplete request. These error codes that you will work with are based on the Hypertext Transfer Protocol (HTTP).
The main focus of this chapter is servlet ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access