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.
- Open
struts.xmlin the project view and click Graph in the bottom of the window.
- 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.
- In the Project tool window, select the element in the project tree. Then select in the context menu.
- Switch to the
struts.xmland make the necessary changes manually.