2.1.3.1. Creating a New JSF Project

If you want your project has already contained all JSF libraries, tag libraries and JSF configuration file, just organize a new brand JSF project. JBoss Developer Studio allows to do this easily with the help of the special wizard. To get it, select File > New > Project > JBoos Tools Web > JSF > JSF Project and click Next.

Choosing a JSF Project

Figure 2.10. Choosing a JSF Project


On the next form you'll be prompted to enter Project Name and select a location for the project or just leave a default path.

Here, JSF Version also allows you to select which JSF implementation to use.

Creating a New JSF Project

Figure 2.11. Creating a New JSF Project


JBoss Developer Studio comes with a number of predefined project templates that are flexible and easily customizable. Thus you can pick a different template on which the project should be based to. Almost all templates come in two variations: with jsf libraries and without ones.

Choosing JSF Templates

Figure 2.12. Choosing JSF Templates


The table below provides description for each possible JSF template.

Template

Description

JSFBlankWithLibs

This template will create a standard Web project structure with all JSF capabilities

JSFKickStartWithLibs

This template will create a standard Web project structure but will also include a sample application that is ready to run

JSFKickStartWithoutLibs

Some servers already provide jsf libs and you take risk of getting conflicting libraries while deploying your project. To avoid such conflicts, use a template without libs if you have a server with its own jsf libraries

Table 2.2. JSF Project Templates


On the next screen select what Servlet version to use and whether to register this application with JBoss AS (or other server) for running and testing of your application.

The Context Path is the name under which the application will be deployed.

The Runtime value tells Eclipse where to find Web libraries in order to build (compile) the project. It is not possible to finish project creation without selecting Runtime. If you don't have any values, select New... to add new Runtime.

The Target Server allows you specifying whether to deploy the application. The Target Server corresponds to the Runtime value selected above. If you don't want to deploy the application, uncheck this value.

Registering the Project on Server

Figure 2.13. Registering the Project on Server


When you are all done, you should have the project that has been appeared in the Package Explorer view:

A New Project in the Package Explorer

Figure 2.14. A New Project in the Package Explorer


At this point you can open faces-config.xml and start working on your application. JBDS provides a lot of features to develop JSF applications. We will describe the features further.