IntelliJ IDEA 2017.1 Help

Defining Seam Navigation Rules

This feature is supported in the Ultimate edition only.

On this page:

Introduction

If you have to define views for a whole application, use the global pages.xml 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 pages.xml file.

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 pages.xml file. All the *.page.xml files detected in a module are collected and included in the common graph.

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.

Creating pages.xml file

To create pages.xml file

  1. In the Project view, right-click the WEB-INF directory.
  2. On the context menu, choose New | Seam pages.xml. Stub pages.xml file is created.
  3. 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.
      SeamNavigationRules4.png
    • 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:
      SeamNavigationRules3.png
      SeamNavigationRules1.png

    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.

Opening page navigation rules file

To open the page navigation rules file

  • In the Project view of the Project tool window, right-click the pages.xml file, and choose Jump to Source, or just press F4.
    /help/img/idea/2017.1/SeamNavigationRules2.png

See Also

Last modified: 18 July 2017