Top Banner
JAVA SERVER FACES Seminar By Chavan Rahul D.
21
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: FINAL JAVA SERVER FACES

JAVA SERVER FACES

Seminar By Chavan Rahul D.

Page 2: FINAL JAVA SERVER FACES

WHAT IS JAVA SERVER FACES?

Framework !!!

Provides set of reusable custom

components.

Provides set of JSP tags to access those

components.

Page 3: FINAL JAVA SERVER FACES

DETAILED FEATURES OF JSF

JSF is standard web user interface framework for Java. Built on top of Servlet API. JSF is a component framework UI components are stored on the server. Easy use of third party components. Event driven programming model. Events generated by user are handled on the server. Navigation handling. Can automatically synchronize UI components. JSF supports multiple client devices. JSF has extensible architecture. International language support.

Page 4: FINAL JAVA SERVER FACES

JSF ADVANTAGES

• Less code• Custom GUI controls.• Form validation• Event handling.

• Events can respond to particular buttons, changes in values, user selections, etc.

• Managed beans• JSF extends this capability and adds in

several utilities, which greatly simplifies processing of request parameters

Page 5: FINAL JAVA SERVER FACES

JSF DISADVANTAGES

• Steep learning curve -- requires large JSF API as well as JSP and servlet APIs

• Less transparent – much is going on that you cannot see

• Relatively new – less documentation and less support from IDE

• Less flexible – cannot depart from the approach given by framework. Note: this consistency can be an advantage

• Not Enough Documentation.

Page 6: FINAL JAVA SERVER FACES

Three main parts to JSF

• A Collection of GUI components• An Event Driven Programming Model• A component model supporting third party

component development

Page 7: FINAL JAVA SERVER FACES

JSF ARCHITECTURE

JSF follows MVC framework Model: objects and properties of application View: Renderers take care of view. Controller: FacesServlet/ JSF infrastructure defines the

flow of the application.

Page 8: FINAL JAVA SERVER FACES

JSF Application Architecture:-

Page 9: FINAL JAVA SERVER FACES

JSF LIFE CYCLE OVERVIEW (FROM THE J2EE TUTORIAL)

Page 10: FINAL JAVA SERVER FACES

Restore viewJSF keeps a copy of the client view and

component state on the server. During the restore view phase the JSF implementation will either create a new view for an initial page request, or render the server-side copy during a post-back request.  Apply request values

Updates the server-side view with the new component values.  Process validations

Performs conversion and/or validation of new component values. 

Page 11: FINAL JAVA SERVER FACES

Update model valuesUpdates the server-side components with

their new values. Invoke application

Invokes any server-side application logic contained within your managed bean. Render response

Renders the new view as directed by your backing bean and/or navigation mapping.

Page 12: FINAL JAVA SERVER FACES

UI Component Model

JSF is all about UI component model.

Java Server Faces UI components are configurable, reusable elements that compose the user interfaces of Java Server Faces applications.

Java Server Faces technology provides a rich, flexible component architecture

Page 13: FINAL JAVA SERVER FACES

User Interface Component Classes

JSF provides a set of UI component classes and associated behavioral interfaces that specify all the UI component functionality, such as holding component state, maintaining a reference to objects, and driving event handling and rendering for a set of standard components.

Page 14: FINAL JAVA SERVER FACES

Component Rendering Model

The Java Server Faces component architecture is designed such that the functionality of the components is defined by the component classes, whereas the component rendering can be defined by a separate renderer. Single behavior of a component once but create multiple renderersA render kit defines how component classes map to component tags that are appropriate for a particular client.

Page 15: FINAL JAVA SERVER FACES

Conversion Model

A Java Server Faces application can optionally associate a component with server-side object data.

When a component is bound to an object, the application has two views of the component's data:

The model view, in which data is represented as data types. Ex

The presentation view, in which data is represented in a manner that can be read or modified by the user.

Page 16: FINAL JAVA SERVER FACES

Event and Listener Model

Java Server Faces technology supports three kinds of events: value-change events, action events, and data-model events.

An action event occurs when the user activates a component that implements ActionSource. These components include buttons and hyperlinks.

Page 17: FINAL JAVA SERVER FACES

Validation Model

Implement a Validator interface that performs the validation.

Implement a backing bean method that performs the validation. If you are implementing a Validator interface, you must also: 1) Register the Validator implementation with

the application2) Create a custom tag or use a validator tag

to register the validator on the component.

Page 18: FINAL JAVA SERVER FACES

Backing Bean (Model Object) Management

Binding a component instance to a bean property has these advantages:

The backing bean can programmatically modify component attributes. The backing bean can instantiate components rather than let the page author do so.

Binding a component's value to a bean property has these advantages: The page author has more control over the component attributes. The backing bean has no dependencies on the Java Server Faces API

Page 19: FINAL JAVA SERVER FACES

Page Navigation

The Java Server Faces (JSF) Navigation Framework provides navigation rules that allow you to define navigation from view to view (mostly JSP pages) in a Web application.

Page 20: FINAL JAVA SERVER FACES

Q & A

Page 21: FINAL JAVA SERVER FACES

Thank You !!!