Previous Section  < Day Day Up >  Next Section

2.1 Developing an Application with a JSF-Based User Interface

To get an idea of how JSF simplifies development and maintenance of complex web-based user interfaces, let's implement a simple newsletter subscription application. The application contains a form where the user enters an email address and selects the newsletters of interest from a list, plus a button for submitting the form. Figure 2-1 shows this user interface.

Figure 2-1. Newsletter subscription form
figs/Jsf_0201.gif

When the user submits the form, the email address and subscription list is saved in a database. Other parts of the application use this information to send the newsletters, but we'll focus on this single page here.

JSF-based application development involves a number of different activities. It helps to define the different roles that the developers play, and then discuss the application aspects each role is responsible for. One person can, of course, take on more than one role. First, you need an implementation of the JSF framework itself. This is the responsibility of the JSF implementor, a role that's usually performed by web container vendors. Another role, the tool provider, is responsible for developing tools to support JSF application development. Some web container vendors take on this role as well, but vendors specializing in development tools, such as Macromedia, are also likely candidates. Remember that JSF is a specification, not a product, so you have a choice of many competing implementations.

Most development projects use an existing JSF framework and tools, so let's focus on the remaining roles: the application developer, the component writer, and the page author. Implementing the newsletter subscription example shows you what parts each role is responsible for and gives you a glimpse of how JSF works.

    Previous Section  < Day Day Up >  Next Section