Managing JSF with Faces Console

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.

Getting ready

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:

Getting ready

Faces Console can also act as a plugin for the most popular Java IDEs. The supported IDEs are as follows:

  • Borland JBuilder 4.0 and higher
  • Eclipse 1.0 and higher
  • IBM WebSphere Appl. Dev. 4.0.3 and higher
  • IntelliJ IDEA 3.0 (build 668) and higher
  • NetBeans 3.2 and higher
  • Oracle JDeveloper 9i and higher
  • Sun One Studio (Forte) 3.0 and higher

The address http://www.jamesholmes.com/JavaServerFaces/console/help.html provides a quick guide to the plugin Faces Console in the previous Java IDEs.

How to do it...

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:

How to do it...

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:

How to do it...

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:

How to do it...

Note

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:

  • Create a plugin for JEdit
  • Add the ability to clone elements
  • Add support for XML entities in config files
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset