Previous Next vertical dots separating previous/next from contents/index/pdf

Adding global and local exceptions to a Struts configuration

Struts allows exception handlers to be added to a Struts configuration in order to process application exceptions as they occur at runtime. Exceptions can be added to the global Struts configuration or locally to an action element within the Struts configuration.

Inserting an exception using the Struts configuration form editor

  1. Open a Struts Configuration file using the Package Explorer.
  2. In the Struts Config view, you will see the list of Struts artifacts including the current list of Global Exceptions. You can expand this list by clicking the plus sign (+) if it is collapsed.
  3. Right-click the Global Exception node and select New Exception.
  4. Enter exception properties and the exception paths through the resulting Exception Tag dialog.
  5. Click OK to insert the exception into the opened Struts configuration file. The new exception will appear under the list of Global Exceptions and can be modified by selecting the specific exception and updating the exception properties.
  6. Note: Using this technique will insert a global exception by default. A local exception will only be inserted by right-clicking an action under the list of Action Mappings and selecting New Exception.

Inserting an exception from the Struts outline view

  1. To insert a global exception from the Struts outline view

  2. To insert a local exception from the Struts outline view

Inserting an exception from the Struts navigation editor

  1. To insert a local exception from the Navigation tab

Related concepts

Struts
Struts Configuration

Related tasks
Creating a new Struts action
Adding global and local forwards
Navigating with the Struts outline view
Working with Struts applications

Related reference

Action Exception Dialog
Insert Exception Dialog
Struts User Guide

 

Skip navigation bar   Back to Top