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)JSF must be synergistic with:
– JSP 1.2 (JSR-53)
– JSTL 1.0 (JSR-52)JSF is not part of J2EE 1.4 standard yet
– Portals (JSR-168)
– Will be considered for J2EE 5.0JSF Built in classes
– It is included in J2EE 1.4 SDK, however
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
a single JavaServer Faces request, and the rendering of the corresponding response.
processing lifecycle
PhaseListener
and ending of processing for each standard phase of the request processing lifecycle
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:
Post a Comment