IntelliJ IDEA 2017.1 Help

Managing 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.

To switch between the views

  • Open struts.xml in the project view and click Graph in the bottom of the window.

To create a Struts 2 application element

  1. Switch to the Project tool window and select Project in the View as drop-down list.
  2. Right-click the struts.xml node and select New in the context menu. Then select the relevant element type. The New... dialog box opens.
  3. Specify the element data and click OK. A new element is created and displayed in the project tree. The corresponding source code is generated in the struts.xml.

To remove a Struts application element, do one of the following

  • In the Project tool window, select the element in the project tree. Then select Delete in the context menu.
  • Switch to the struts.xml and make the necessary changes manually.

See Also

Last modified: 18 July 2017