Java Reference
In-Depth Information
The introduction of JSF to the Java EE specification resulted in a standard, very
capable web application framework available in any Java EE-compliant application
server. With JSF being the standard Java EE framework, nowadays many Java
enterprise application developers choose to use JSF to develop their user interface.
Developing our first JSF application
From an application developer's point of view, a JSF application consists of a series
of XHTML pages that contain custom JSF tags, one or more CDI named beans, and
an optional configuration file named
faces-config.xml
.
The
faces-config.xml
file was required in JSF 1.x; however,
in JSF 2.0, some conventions were introduced to reduce the need
for configuration. Additionally, a number of JSF configurations
can be specified using annotations, reducing and, in some cases,
eliminating the need for this XML configuration file.
Previous versions of JSF required JSF managed beans to implement server-side
functionalities. For backward compatibility, JSF managed beans are still supported;
however, CDI named beans are preferred in modern JSF applications.
Creating a new JSF project
To create a new JSF project, we need to go to
File
|
New Project
, select the
Java Web
project category, and select
Web Application
as the project type.
After clicking on
Next
, we need to enter a project name and, optionally, change other
information for our project. However, NetBeans provides sensible defaults.