O'Reilly logo

Seam Framework: Experience the Evolution of Java™ EE, Second Edition by Thomas Heute, Jacob Orshalick, Michael Juntao Yuan

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

17 Failing Gracefully

Like input validation, error handling is a very important aspect of a web application, but it is hard to do right. Without proper error handling, uncaught exceptions in the application (e.g., a RuntimeException or a transaction-related exception) would propagate out of the web framework and cause a generic “Internal Server Error” (HTTP error code 500). The user would see a page full of technical jargon and a partial stack trace of the exception itself (see Figure 17.1). That is certainly unprofessional. Instead, we should try to fail gracefully and display a nice custom error page for the user.

Figure 17.1. An uncaught exception from the Seam event handler method

With the tight integration between business ...

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