JBoss.orgCommunity Documentation
First, we should mention that JSF configuration file ( faces-config.xml ) is intended for registering JSF application resources such as Converters, Validators, Managed Beans and page-to-page navigation rules.
Now, let's look at how you can easily configure this file by means of a special graphical editor for JSF configuration file. The editor has three main views:
Diagram
Tree
Source
They can be selected via the tabs at the bottom of the editor.
Here, we will show you how to work with JSF configuration file through the Diagram view of the editor.
As you can see on the figure below, the Diagram view displays the navigation rules in the faces-config.xml:
If your diagram is large, make use of the Outline view. Within it you can switch to a Diagram Navigator mode by selecting the middle icon at the top of the view window. It allows you to easily move around the diagram. Just move the blue area in any direction, and the diagram on the left will also move:
To create a new page here, you should click the page icon (View Template) on the toolbar from the left and then click anywhere on the diagram. A New Page Wizard will appear.
To create a transition for connecting pages:
Select the transition icon from the toolbar (New Connection).
Click the source page.
Click the target page.
A transition will appear between the two pages:
It is also possible to create a new page with context menu by right-clicking anywhere on the diagram and selecting New View.
To edit an existing transition, first select the transition line. Then, place the mouse cursor over the last black dot (on the target page). The mouse cursor will change to a big +. At this point, drag the line to a new target page:
The Tree view for the editor displays all JSF application artifacts referenced in the configuration file in a tree format. By selecting any node you can see and edit its properties which will appear in the right-hand area. For example, a Managed Bean:
To edit some artifact, right-click any node and select one of the available actions in the context menu. You can also edit in the properties window to the right:
The same way you can create a new artifact:
In the Tree view you can also edit the properties of the selected element with the help of the Properties view as shown below:
Here, we'll discuss how you can configure your faces-config.xml with the help of Source View.
The Source view for the editor displays a text content of the JSF configuration file. It is always synchronized with other two views, so any changes made in one of the views will immediately appear in the other:
You can also work in the Source view with the help of the Outline view. The Outline view shows a tree structure of the JSF configuration file. Simply select any element in the Outline view, and it will jump to the same place in the Source editor, so you can navigate through the source code with Outline view.
Here we'll discuss a very important features that JSF configuration file editor provides for work with JSF resources.
The JSF configuration file editor comes with a very useful OpenOn navigating feature. More fully you can read about it in our Visual Web Tools Guide.
Code Assist provides pop-up tip to help you complete your code statements. It allows you to write your code faster and with more accuracy.
Code assist is always available in the Source mode:
When you are developing your project, error checking is constantly provided. This greatly reduces your development time as it allows you to catch many of the errors during development.
Errors will be reported by verification facility:
Other errors are also reported.