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