O'Reilly logo

Learning Jakarta Struts 1.2: a concise and practical tutorial by Stephan Wiesner

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

8.3 Exception Handling

Struts has the option of embedding error handling directly in the Action class. The next example shows why this is a good idea for us. First, create an Author and then create another using the same ID. It displays an error message that may be understood by a programming veteran, but is likely to be disconcerting for any other user.

8.3 Exception Handling

Figure 8.2: Standard Tomcat error message

The Struts documentation on error handling (http://127.0.0.1:8080/struts-documentation/userGuide/building_controller.html#exception_handler) is woefully inadequate. We now go over an example to make the process clear. Let’s assume that we have to catch the ...

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