JBoss Tools 3 Developer Guide
Creating a JSF Project Stub
In this section you will see how to create a JSF project stub with JSF Tools. This is a straightforward task that is based on the following steps:- From the File menu, select New | Project option. In the New Project window, expand the JBoss Tools Web node and select the JSF Project option (as shown in Figure 3). After that, click the Next button.
Click here for larger image
Figure 3: Create a JSF Project - In the next window, it is mandatory to specify a name for the new project (Project Name field), a location (Location fieldonly if you don't use the default path), a JSF implementation (JSF Environment field), and a template (Template field). As you can see, JSF Tools offers a set of predefined templates as follows:
- JSFBlankWithLibs This is a blank JSF project with complete JSF support.
- JSFKickStartWithLibs This is a demo JSF project with complete JSF support.
- JSFKickStartWithoutLibs This is a demo JSF project without JSF support. In this case, the JSF libraries are missing for avoiding the potential conflicts with the servers that already offer JSF support.
- JSFBlankWithoutLibs This is a blank JSF project without JSF support. In this case, the JSF libraries are missing for avoiding the potential conflicts with the servers that already offer JSF support (for example, JBoss AS includes JSF support).
Figure 4 is an example of how to configure your JSF project at this step. At the end, just click the Next button:
Click here for larger image
Figure 4: Configure Your JSF ProjectThis step allows you to set the servlet version (Servlet Version field), the runtime (Runtime field) used for building and compiling the application, and the server where the application will be deployed (Target Server field). Note that this server is in direct relationship with the selected runtime. Figure 5 shows an example of how to complete this step (click on the Finish button):
Click here for larger image
Figure 5: Set the Servlet Version, the Runtime, and the Server
JSF Project Verification
Before starting to develop a JSF application, you can take advantage of an important facility of JSF Tools: the ability to verify and report any dysfunction that may affect the application flow. This facility, known as the JSF Project Verification, will verify the application when it is saved and help you to easily identify errors. For this, you can follow these steps:- From the Window main menu, select the Preferences option.
- In the Preferences window, expand the JBoss Tools | Web | Verification node from the left panel.
- Select the desired checkboxes and click on Apply and OK (it is recommended to select all of them).
JSF Application Configuration File
A very useful facility of JSF Tools is an editor especially designed for managing everything that is related to the JSF main configuration file (faces-config.xml). You can start this editor like this:- Place the cursor in the Package Explorer view on your project node.
- Expand your JSF project node: registerJSF | WebContent| WEB-INF.
- Double-click on the faces-config.xml file.
When the editor is available, it will appear as in Figure 6.
Click here for larger image
Figure 6: JSF Tools Editor for Managing faces-config.xml
Page 2 of 5
This article was originally published on June 4, 2009