站内搜索: 请输入搜索关键词
当前页面: 图书首页 > Servlets and JavaServer Pages: The J2EE Technology Web Tier

Servlets and JavaServer Pages: The J2EE Technology Web Tier

[ directory ]Summary Errors and Exceptions

Chapter 4. Exception Handling

Exceptions are an integral part of the Java programming language. When a program violates the rules of Java, the Java Virtual Machine halts execution of the program and generates an exception. Managing exceptions is something every Java program must do. Servlets and JSP are no different. Until now, the topic of programming errors has largely been ignored in favor of introducing JSP and Servlets. While necessary for the start of this book, errors are inevitable and need to be understood so they can be dealt with appropriately. It is the goal of this chapter to clearly explain what exceptions are and how to deal with them in Servlets and JSP.

This chapter discusses the following topics:

The preceding points imply this chapter assumes little to nothing about previous knowledge of Java exception handling. This implication is true; the chapter is designed to be suited for both Java developers and "Java" developers who never bothered to truly learn exception handling, who are surprisingly abundant. The chapter is designed to be read straight through, but if you already have a firm grasp on Java exception handling, you may skip the first section and start in on the discussion of Servlet and JSP exception handling.

[ directory ]Summary Errors and Exceptions