tell me more icon Creating JSF Page Navigation

To follow along with the example, enter values or select options as shown in the instructions throughout the cue cards. Then you will be able to follow the steps in the cue cards exactly as written.

JSF page navigation is a set of navigation rules that determine the next page to be displayed when a user clicks a button or link on a page. The navigation rules are defined in the JSF application's configuration resource file, which is named faces-config.xml by default.

Elements that can be included in a JSF configuration file

All JSF applications have a faces-config.xml file. The JSF configuration file contains details of your application, such as the locales you are supporting and the rules for navigating between application pages. The configuration file also holds details of the resources needed by your application, such as:

  • Managed beans
  • Custom message bundles
  • Custom validators and converters

When you create an application in JDeveloper using a template for a JSF application or when you create a JSF page, a faces-config.xml file is automatically created for you in the project. When you create an application without using a template, you can create the faces-config.xml file using the Create JSF Configuration File dialog.

To open the Create JSF Configuration File dialog, in the Application Navigator, you will right-click the project and choose New . Then in the New Gallery, expand the Web Tier category and choose JSF, and in the Items list, choose JSF Page Flow & Configuration (faces-config.xml).

New Gallery, Web Tier, JSF

In the Create JSF Configuration File dialog, you will select the web application version, as this is the first JSF configuration file to be created in the project.

Create JSF Configuration File dialog

By default, JDeveloper opens a new faces-config.xml file in the JSF navigation diagrammer.

JSF navigation diagrammer and Component Palette

In JDeveloper, there are three ways you can add information to or edit a JSF configuration file. In the editor window, you can click:

  • Diagram to use a JSF navigation diagram to plan out the pages in your JSF application, and define the navigation rules for users to navigate between the pages.
  • Overview to use the overview editor and dialogs to add and edit configuration elements.
  • Source to use the XML source editor to edit the XML code, if you are familiar with the configuration element names.

All these tools edit the same JSF configuration file; use whichever tool is most appropriate for each item you are adding or editing.

In the example, you will use the JSF navigation diagrammer. You will create three pages and define two possible ways to navigate from one of the pages to the other two pages. You will use JSF diagram objects from the Component Palette to draw the page representations and the navigation between the pages on the JSF navigation diagram.

JSF navigation diagram

Copyright © 1997, 2009, Oracle. All rights reserved.

false ,,,,,,,,,,,,,,,