Sunday, November 2, 2008

JAVA SERVER FACES (JSF)

JSF

A server side user interface component framework for Java-based web applications

A specification and reference implementation for a web application development framework

– Components
– Events
– Validators & converters
– Navigation
– Back-end-data integration

Struts and JSF can be used together

JSF provides Drag-and-drop UI components to build a web Application.

Next generation Web application framework based on component model

We can create JSF application by writing JSP pages yourself

JSF Basic Capabilities

* Extensible user interface (UI) component model

* Flexible rendering model

* Event and listener handling model

* Per-component validation framework

* Basic page navigation support

* Internationalization and accessibility

* Extensible Component and Rendering architecture

* Support for client device independence

* Huge vendor and industry support

JSF Concepts

UIComponent

Render-independent characteristics

Base class with standard behaviors

Standard UIComponent Subclasses

UICommand, UIForm, UIGraphic, UIInput, UIOutput, UIPanel,
UISelectBoolean, UISelectMany, UISelectOne

FacesEvent

Base class for request and application events

Validator

Base class for standard and application defined validators

Converter

Plug-in for String-Object conversion

FacesContext

– Servlet request, response, session
– JSF request, response trees
– Model reference expression evaluators

Syntax similar to the expression language of the JSP Standard Tag Library (JSTL) 1.x

Primary interface between components and the data provided by (or to) the application

JSF Key Concepts

Renderer

– Converts components to and from a specific markup language
– Supports render-dependent attributes on components
– May support more than one component type

RenderKit

– Library of Renderers
– Extensible at runtime
– Basic HTML RenderKit is part of the specification

JSF is based on:
– Servlet 2.3 (JSR-53)
– JSP 1.2 (JSR-53)
JSF must be synergistic with:
– JSTL 1.0 (JSR-52)
– Portals (JSR-168)
JSF is not part of J2EE 1.4 standard yet
– Will be considered for J2EE 5.0
– It is included in J2EE 1.4 SDK, however
JSF Built in classes

UIViewRoot

● UIViewRoot is a UIComponent that represents the root of the UIComponent tree.

● Serves as the root of the component tree,and as a place to hang per-view PhaseListeners

FacesContext

● Contains all of the per-request state information related to the processing of
a single JavaServer Faces request, and the rendering of the corresponding response.

● It is passed to, and potentially modified by,each phase of the request
processing lifecycle

PhaseListener

● An interface implemented by objects that wish to be notified at the beginning
and ending of processing for each standard phase of the request processing lifecycle

● You can provide your own implementation of PhaseListener and plug it
into the application for custom request handling – Ajax request handling

● Before and after each phase handling
– “around” semantics

Application Class

● Represents a per-web-application singleton object

● Maintains application wide objects

– set of supported locales
– converters
– validators

● Serves as a factory for creating components,converters, and validators
public abstract UIComponent createComponent(String componentType) throws FacesException

0 comments:

Blog Widget by LinkWithin

JS-Kit Comments

  © Blogger template Newspaper III by Ourblogtemplates.com 2008

Back to TOP