In this recipe, we introduce you to a simple and nice tool, named Faces Console. This is a free "standalone Java Swing application for developing and managing JavaServer Faces-based applications". Practically, this tool can be used to visually edit JSF configuration files (such as faces-config.xml
and web.xml
) and JSP Tag Library files.
When this book was written, the Faces Console stable version was 1.7 and it can be downloaded from http://www.jamesholmes.com/JavaServerFaces/console/. Notice that, in the simple case, Faces Console can be unzipped anywhere and can be started from the /bin
folder, by double-clicking on the console.bat
file. It will start like any Swing standalone application, as you can see in the following screenshot:
Faces Console can also act as a plugin for the most popular Java IDEs. The supported IDEs are as follows:
The address http://www.jamesholmes.com/JavaServerFaces/console/help.html provides a quick guide to the plugin Faces Console in the previous Java IDEs.
After you launch the Faces Console (as standalone or under an IDE) you will see the previous screenshot. You can start by creating a new JSF configuration or TLD file or you can try to modify an existing one. For creating a new file, choose the New option from the File menu—the pop-up window shown in the following screenshot will be displayed:
As you can see, currently there are four types of files that can be created and validated by the Faces Console application. After you select a type (for example, we selected the Faces 1.1 Configuration File), you will see the following:
The right panel will reveal the main nodes contained by a faces-config.xml
file, while the left panel provides a visual GUI for populating the configuration file (each node has its own visual GUI). For example, in the next screenshot, we have added a navigation rule using the corresponding GUI:
You can switch between the visual GUIs and source code by using the Editor and Source tabs from the right panel. The Source view is not editable by hand!
If you take a look into the Options menu, you will notice that Faces Console also provides validation support for the loaded configuration/TLD files. This option can be disabled if you want to work with a non-valid file.
From this point forward, you can try to explore on your own and see how easy it is to manage JSF configuration/TLD files using Faces Console. Also, you may want to keep in mind these possible upcoming functionalities: