Defining Seam Navigation Rules
If you have to define views for a whole application, use the global
file. This file contains description of the navigation rules, page actions, and exception handling.
For a large application this file can grow too large, and in this case
it makes sense to create a number of fine-grained
*.page.xml files, one file
per page. So doing, the global items should be still described in the
IntelliJ IDEA provides Navigation Graph as an additional tab to the textual source of the xml file. In this view you can explore the page navigation rules in a convenient way.
The Navigation Graph tab is only available for the global
*.page.xml files detected in a module are collected and included in the
It is very important to properly configure the Web resource directories for a Web facet of your module. In particular, the directories that contain pages to be included in the navigation rules, should be added to the list of Web resources.
To create pages.XML file
- In the Project view, right-click the
- On the context menu, choose
pages.xmlfile is created.
- Populate the file with the necessary pages, and define navigation rules. You can do it in one of the
two possible ways:
- Open the Navigation Graph tab, in the Project view select the desired pages, and drag-and-drop them to the diagram background. Draw links between the nodes.
- Open the Text tab, and type the source code for the navigation rules. Note that code completion is available for the paths to the pages, xml elements and expression language:
Note that source code of the page navigation file is fully synchronized with the Navigation Graph. Adding or removing a page or a link to/from the Navigation Graph is immediately reflected in the source code.
To open the page navigation rules file
- In the Project view of the Project tool window, right-click the
pages.xmlfile, and choose , or just press .