Tutorial: JavaServer Faces Application

This tutorial shows you how to create a simple JSF application using Workshop.
The introduction below provides (1) an explanation of the technology used
in the tutorial and (2) a description of the application created in the tutorial.

Technology Used in the JSF Tutorial

JSF

JavaServer Faces (JSF) technology simplifies building user interfaces for JavaServer applications. Developers can quickly and easily build web applications by assembling reusable UI components in a page, connecting these components to an application data source / model, and wiring client-generated events to server-side event handlers. The user interface code runs on the server, responding to events generated on the client. This allows the application developer to focus on application code.

Workshop JSF Tools

Workshop
facilitates development of sophisticated
web applications based on the server-side technology JavaServer Faces (JSF).

Other concepts/features

Application Database and AppXRay

The Workshop group of products incorporate AppXRay,
which scans all of the elements of imported web applications and creates an
intelligent map of the relationships between them. These elements include
Java application logic, JSP files, Struts artifacts, JSF artifacts, web and
configuration XML files, resource bundles, application variables, properties,
etc. As the application is scanned, AppXRay dynamically builds an application
database of this intelligence. The database is incrementally updated as you
make changes to the web application. The AppXRay capabilities provide an incredibly
high level of productivity in creating, editing, or debugging any part of
your web application.

Consistency Checking

For any changes you make to your application, Workshop continuously monitors it and identifies potential errors. These errors are presented through the standard Eclipse error presentation system using the Workbench Problems view. For consistency checking, Workshop fully utilizes the application database.

Synchronized Editing

Workshop editors support real-time synchronization between Source and Design panes. Any changes being made in either the source pane or the design-pane will be immediately reflected in the other view.

AppXaminer

Workshop introduces AppXaminer, to manage web dependencies and visually display the relationships between resources. It provides automatic problem detection and ease of navigation throughout the environment.

AppXNavigator

Workshop introduces AppXNavigator, for hyperlink style navigation
which is available in all editors and can be used to navigate to any Java,
JSP, Struts, or JSF dependency from within the editor. It helps in search
or to refer to a specific resource.

Application Description

The sample application used in this tutorial is a web application for an
IT solutions company. It allows registered users to download various software.
In this tutorial, you will develop one of the modules "Registration and
Login"
of the web application.

For new users, the application requests the user to register first. During
registration, the user is required to provide a user id, password, full name
and contact details like address, city, zipcode, phone number, etc. The user
id must be unique and have a maximum of 8 characters. The password must be
a four digit number ranging between 1000 and 9999.

Registered users provide their user id and password to login. The application
verifies the user id and password. If valid, the user will be forwarded to
the page for downloading the software.

Web Components

The following are the software components of the sample web application.

HTML and CSS files

login.jsp

Displays the login form for user id and password. It submits the request
to the LoginBean.validate action. If the user id and password
are valid then the application will display home.jsp page otherwise
it asks to re-login.

register.jsp

Displays the registration form for entering information like user id,
password, name, contact details, etc. It submits the request to the UserBean.registerUser
action. On successful registration, the application will navigate
to home.jsp page.

home.jsp

Shows a welcome message and a link to download the software.

stylesheet.css

CSS file to customize the appearance of JSP pages.

Helper / Model classes

MessageFactory

Helper class that retrieves messages from the application resource bundle.

LocalManager

Provides a static method to update the application locale at run-time.

DataStoreBean

Represents a transient data store that maintains a list of registered
users.

In the next step, you will create a workshop-jsf-tutorial
project from the sample web application which contains support files (.java
and .jsp files) and resources (images, .css file) for JSF application. Using
the resources and steps described in this tutorial, you will learn how to
develop JSF applications using Workshop.