Add Exception Dialog Box
See Also
A Struts exception handler lets you declaratively handle exceptions in the
struts-config.xml file. Instead of solving exceptions in Java code,
you can specify the resource that should deal with the exception. You can also
specify the message that should be displayed to the user when an exception occurs.
You can finetune exception handling by providing a different solution for each
type of exception or you can let all exceptions be handled in the same way.
You use the Add Exception dialog box to register an exception handler in the struts-config.xml file.
You open the Add Exception dialog box by right-clicking in a struts-config.xml file and
choosing Struts > Add Exception.
In the Add Exception dialog box, you set the following properties:
- Resource Bundle. Specifies the servlet context attribute for the message resources bundle
associated with this handler. The default attribute is the value specified by the string constant declared at Globals.MESSAGES_KEY.
- Bundle Key. Specifies the name of the key in the resource bundle that identifies the message
to be displayed to the user.
- Exception Type. Specifies the type of exception that must occur for the exception handler to be
used.
- Call.
- Resource File. Specifies the resource file that will handle the exception. For example,
if a JSP page is set as the resource file, Struts will display the specified JSP page when the
exception occurs.
- Action. Specifies the action that will handle the exception.
- Scope. Specifies the scope within which the exception handler is applicable. By default, the exception handler
is set to Session scope.
- Location.
- Global. Specifies that the exception handler applies to all actions.
- Action. Specifies the specific action to which the exception handler applies.
- If you want to change a registered exception handler, you can do
so by manually editing the XML tags in the struts-config.xml file.
- See Also
- About Struts Framework Support
- Creating a New Application with Struts Support
- Adding Struts Support to an Existing Application
- About Web Application Frameworks
Legal Notices