Creating global exceptions

A Struts exception is an element defined in a Struts configuration file that specifies how to handle Java™ exceptions that occur during execution of Struts actions. You can define an exception handler to run when the

execute method of an action throws an exception.

A Struts exception is an element defined in a Struts configuration file that specifies how to handle Java exceptions that occur during execution of Struts actions.

To create a global exception:

  1. In Enterprise Explorer, right-click your Web project and select

    New | Other | Web | Struts | Struts Exception.

  2. Click Next. The New Struts Exception wizard opens.

  3. In the Type field, click Browse to select the exception type.

  4. Type the Path value for your exception.

  5. In the Handler field, click Browse to select an exception handler class name.

  6. Select

    Global for the exception context.

  7. Specify a key for the error message and (optionally) a resource bundle to contain the key.

  8. Click Finish.