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.
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 facilitates development of sophisticated web applications based on the server-side technology JavaServer Faces (JSF).
Workshop provides an integrated development environment for building JSF-based web applications. Workshop offers synchronized, split-pane source and visual (WYSIWYG) editors for JSF and supports sophisticated code completion, error checking and validation features that reaches multiple-levels.
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.
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.
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.
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.
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.
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.
The following are the software components of the sample web application.
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.
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.
Shows a welcome message and a link to download the software.
CSS file to customize the appearance of JSP pages.
Helper class that retrieves messages from the application resource bundle.
Provides a static method to update the application locale at run-time.
Represents a transient data store that maintains a list of registered users.
Managed Bean responsible for validating user id and password.
Serializable bean holding user information like user id, password, full name, contacts details, etc. It implements the method getRegisteredUser( ) to store user information in the database.
Holds contact information like address, city, state, zipcode, country, office phone number and home phone number.
This is notified when the servlet-context is initialized; it creates an instance of DataStore which stores user information (UserBean objects) and it puts it in the application scope.
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.