Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migration of unmigrated content due to installation of a new plugin

...

Java Server Faces (hereafter JSF) is an event based development framework in Java EE5 EE 5 arena. It is a framework for building user interfaces for Web application.
JavaServer Faces JSF uses the existing user interface and Web tier mechanisms but it does not tie up the applications to a particular mark-up language, protocol and client device. It encapsulates various UI component functionality enabling it to render data to various client devices by developing required custom tags. JavaServer Faces technology provides a custom renderer and a JSP custom tag library for rendering to an HTML client, allowing developers of Java EE applications to use JavaServer Faces technology in their applications.

...

  • Helps to reduce duplication in the code
  • Maintenance of the existing code becomes easier
  • Provides a central place to control all the user views- Controller
  • Any new user view can be added and later wired to the controller
  • Debugging the application becomes quite easier
  • Changes to the Model have a minimal effect on View and Controller

Coming back to JSF now, JavaServer Faces JSF technology clearly separates presentation logic from the application logic. Several development roles can be created and designated during the application development state. The JSF technology is developed through Java Community Process under JSR-127.

JSF has the following as the major componentcomponents:

  1. User Interface Components - These are stateful objects which are built over JavaBeans. Each UI component has associated events, properties and methods. These components reside on server side rather than on the client side (for example swing components). In JSF, UI components are rendered for the browser. For any user request components output the HTML, which is then rendered and shown to the user as GUI elements.
  2. Navigation - JSF defines a very effective navigation system. For a given page the navigation rules defines what are the valid outcomes and which page to load for each output.
  3. Renderer - This component is used to render UI components. This component can provide different rendering options depending on different types of browser (for example, Netscape, Internet explorer, Mozilla, Firefox). A renderer translates the user input to values which are understandable by components and vice versa.
  4. Converter - A converter converts data from one type to another. The converted in JSF converts user inputs to components and vice versa.
  5. Validator - A validator validates the user input and verifies whether the input is in acceptable format. In the conventional Web development validation is taken care by scripting languages like Java Script and that puts a considerable overhead over the application. JSF provides the controller mechanism which validates the input. Validation is done at the UI component level as well as the bean level.
  6. JavaBeans - In JSF Java Beans define the interaction between UI component and model. They play the role of Controllers in JSF. We can say that Backing Bean controls the form and the components associated with the form.
  7. Internationalization and Localization - JSF uses the internationalization tags from Java Server pages standard Tag library (JSTL).

This completes what gives the basic idea on architectural design of Java Server Faces JSF and the various components available with Java Server Faces.

JavaServer Faces JSF technology provides

  • APIs for representing user interface components and managing their state, handling events triggered on them, validating inputs entered by user, defining page navigation, supporting internationalization and accessibility.

...

Underlining samples will describe how MVC architecture and various components are being used in application development. Apache geronimo v2.1 2 uses Apache MyFaces v1.2.2 for JSF implementation.