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
- Switch to the Project Tool Window and select in the View as drop-down list.
- Right-click the struts.xml node and select in the context menu. Then select the relevant element type. The New... dialog box opens.
- 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 in the context menu.
- Switch to the
struts.xml
and make the necessary changes manually.
Last modified: 6 March 2018