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:
- In Enterprise Explorer, right-click your Web project and select
New | Other | Web | Struts | Struts Exception.
- Click Next. The New Struts Exception wizard opens.
- In the Type field, click Browse to select the exception type.
- Type the Path value for your exception.
- In the Handler field, click Browse to select an exception handler class name.
- Select
Global for the exception context.
- Specify a key for the error message and (optionally) a resource bundle to contain the key.
- Click Finish.