IntelliJ IDEA 2020.1 Help

Manage Struts 2 elements

Struts 2 elements like actions, results, and interceptors as well as interaction between them is defined in the <package> section of the struts.xml configuration file. The file is created automatically when you enable Struts 2 support for a module.

IntelliJ IDEA provides you with a friendly interface for editing struts.xml both in the text view and in diagram.

Switch between the views

Create a new Struts 2 application element

  1. Right-click the struts.xml file in the Project tool window, select New, and click the element you want to create.

    The New... dialog opens.

  2. Specify the element data and click OK.

    The new element is created and displayed in the project tree. The corresponding source code is generated in the struts.xml.

Remove a Struts 2 application element

  • In the Project tool window, right-click the element you want to remove and select Delete.

    Alternatively, switch to the struts.xml file and make the necessary changes manually.

Last modified: 7 July 2020