Chapter 7. Error Handling and Debugging

When you develop any application that’s more than a trivial example, errors are inevitable. A JSP-based application is no exception. There are many types of errors you will deal with. Simple syntax errors in the JSP pages are almost a given during the development phase. And even after you have fixed all the syntax errors, you may still have to figure out why the application doesn’t work as you intended due to design mistakes. The application must also be designed to deal with problems that can occur when it’s deployed for production use. Users can enter invalid values and try to use the application in ways you never imagined. External systems, such as databases, can fail or become unavailable due to network problems.

Since a web application is the face of a company, making sure it behaves well, even when the users misbehave and the world around it falls apart, is extremely important for a positive customer perception. Proper design and testing is the only way to accomplish this goal. Unfortunately, many developers seem to forget the hard-learned lessons from traditional application development when designing web applications. For instance, a survey of 100 e-commerce managers, conducted by InternetWeek magazine (April 3, 2000 issue), shows that 50% of all web site problems were caused by application coding errors. That’s the highest ranking reason in the survey, ahead of poor server performance (38%), poor service provider performance (35%), ...

Get Java Server Pages now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.