0% found this document useful (0 votes)
13 views17 pages

10310

Uploaded by

bm.agency.dz
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
13 views17 pages

10310

Uploaded by

bm.agency.dz
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 17

Java Server Faces (JSF)

‫ﺑﺳﻡ ﷲ ﺍﻟﺭﺣﻣﻥ ﺍﻟﺭﺣﻳﻡ‬

Java Server Faces (JSF)

Contents
• Introduction to the Author
• Chapter 1: JSF Introduction
• Chapter 2: Understanding Managed Beans
• Chapter 3: Page Navigation
• Chapter 4: JSF Components

Java Developer And Instructor


[email protected]
‫)‪Java Server Faces (JSF‬‬

‫ﺍﻟﺳﻼﻡ ﻋﻠﻳﻛﻡ ﻭﺭﺣﻣﻪ ﷲ ﻭﺑﺭﻛﺎﺗﻪ‬

‫ﺃﺣﺏ ﺃﻋﺭﻓﻛﻡ ﺑﻧﻔﺳﻲ‬

‫ﺍﻻﺳﻡ‪ :‬ﺍﺣﻣﺩ ﻣﺣﻣﺩ ﻋﻘﻝ‬


‫ﺍﻟﻛﻠﻳﺔ‪ :‬ﻛﻠﻳﻪ ﺍﻟﺣﺎﺳﺑﺎﺕ ﻭﺍﻟﻣﻌﻠﻭﻣﺎﺕ ﺟﺎﻣﻌﻪ ﺍﻟﻣﻧﺻﻭﺭﺓ‬
‫ﺍﻟﻔﺭﻗﺔ‪ :‬ﺍﻟﺭﺍﺑﻌﺔ‬
‫ﺍﻟﺗﺧﺻﺹ‪ :‬ﻋﻠﻭﻡ ﺍﻟﺣﺎﺳﺏ‬
‫ﺍﻟﺑﺭﻳﺩ‪:‬‬
‫‪[email protected]‬‬

‫‪Java Developer And Instructor‬‬

‫‪-‬ﺍﻟﻛﺗﺎﺏ ﻋﺑﺎﺭﺓ ﻋﻥ ﺳﻠﺳﻠﻪ ﻣﻥ ﺍﻟﺩﺭﻭﺱ ﻟﺗﻌﻠﻡ ﻛﻳﻔﻳﻪ‬


‫ﺍﻟﺗﻌﺎﻣﻝ ﻣﻊ‬
‫)‪Frameworks(jsf‬‬

‫‪Java Developer And Instructor‬‬


‫‪[email protected]‬‬
Java Server Faces (JSF)

Chapter 1
JSF Introduction

O u tl i n e

�What is JSF?
�Why JSF?
�What JSF looks like?
�Why we need frameworks/ framew orks types?
�Evolution of technologies
�JSF Architecture
�JSF Life cycle
�Application

Java Developer And Instructor


[email protected]
Java Server Faces (JSF)

What is JSF?

• It is a standard Java Framework for building


Web applications.

• It simplifies development by providing a


component-centric approach to developing
Java Web user interfaces.

• A set of Web-based GUI controls and


associated handlers

• JSF provides many prebuilt HTML-oriented


GUI controls , along with code to handle their
events.

• A device-independent GUI control framework

• JSF can be used to generate graphics in


formats other than HTML, using protocols
other than HTTP.

Java Developer And Instructor


[email protected]
Java Server Faces (JSF)

Why JSF?

1. Standard.
2. Easy to use.
3. MVC for web applications.
4. Support for client device
independence.
6. Huge vendor and industry support.
7. Can work with any presentation
technology including JSP.
8. Extendable Component and
Rendering architecture.
9. UI elements is stateful objects on
the server.

Java Developer And Instructor


[email protected]
Java Server Faces (JSF)

What JSF looks like?

• JSF is a Rapid Application


Development (RAD)
• The technology under the hood :

Java Developer And Instructor


[email protected]
Java Server Faces (JSF)

Why do we need frameworks?

• Why do we need frameworks?

– To help to carry some tedious tasks from the


developer , and make it automatic which make
it easy to scale

Java Developer And Instructor


[email protected]
Java Server Faces (JSF)

Types of Frameworks

• Foundation framework:

– Form processing ,
– Page management.
– Type conversion,
– Error handling,
– Enforcing MVC model,
– Not masking the fundamental request /
response nature of HTTP.
– Example ; Struts

• UI framework:

– Form processing ,
– Page management.
– Type conversion,
– Error handling,
– Enforcing MVC model,
Java Developer And Instructor
[email protected]
Java Server Faces (JSF)

– Masking the fundamental request / response


nature of HTTP.
– Component based web application.
– Example ;,ADF, JSF

Evolution of Technologies

Java Developer And Instructor


[email protected]
Java Server Faces (JSF)

JSF Architecture

Java Developer And Instructor


[email protected]
Java Server Faces (JSF)

Request Processing Lifecycle

• Types of the request:

1. Initial Request:
– A user requests the page for the first time.
– Lifecycle only executes the restore view and
render response phases.

2. Post back:
– A user submits the form on a page that was
previously loaded into the browser.
– Lifecycle executes all phases.

Java Developer And Instructor


[email protected]
Java Server Faces (JSF)

Lifecycle of JSF Page

• A JSF page is represented by a tree


of UI components, called a view.

• When a client makes a request for


the page, the lifecycle starts.

• During the lifecycle, JSF


implementation must build the
view while considering state saved
from the previous post back.

• When the client performs a post back


of the page, JSF implementation must
perform lifecycle steps mainly :

- conversion - validation

Java Developer And Instructor


[email protected]
Java Server Faces (JSF)

Request Processing Lifecycle

Java Developer And Instructor


[email protected]
Java Server Faces (JSF)

• Apply Request Values:

– Update the value of the components


to equal ones sent in the request.

– Events fired: Phase events,


action events, data model events

• Process Validations:

– Asks each component to validate


itself.

– If the validation fails, the lifecycle


advances directly to the Render
Response phase to render the page
with the error messages.

– Events fired: Phase events,


Java Developer And Instructor
[email protected]
Java Server Faces (JSF)

value-changed events,
data model events

Request Processing Lifecycle

• Update Model Values:

– Updates all the values of backing


beans or model objects associated
with components.

– Only input components that have


valueRef expressions will be updated.

– If the conversion fails, the lifecycle


advances directly to render Response
so that the page is re-rendered with
errors displayed.

Java Developer And Instructor


[email protected]
Java Server Faces (JSF)

– Events fired: Phase events, data


model events.

Examples in the next


article

Java Developer And Instructor


[email protected]
Java Server Faces (JSF)

Thanks

Java Developer And Instructor


[email protected]

You might also like