O'Reilly logo

Sun™ Certification Training Guide (310-080): Java™ 2 Enterprise Edition (J2EE™) Web Component Developer Exam by Alain Trottier

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required