Oracle Developer Day Sponsored by: Sponsored by: Sponsored by: - - PDF document

oracle developer day
SMART_READER_LITE
LIVE PREVIEW

Oracle Developer Day Sponsored by: Sponsored by: Sponsored by: - - PDF document

Oracle Developer Day Sponsored by: Sponsored by: Sponsored by: Sponsored by: J2EE Track: Session #3 Developing JavaServer Faces Applications Name Title Agenda Introduction to JavaServer Faces What is JavaServer Faces Goals


slide-1
SLIDE 1

Sponsored by: Sponsored by: Sponsored by: Sponsored by:

Oracle Developer Day

J2EE Track: Session #3

Developing JavaServer Faces Applications

Name Title

slide-2
SLIDE 2

Agenda

Introduction to JavaServer Faces

– What is JavaServer Faces – Goals

Architecture

– Request Lifecycle – JSF Components – Developing JSF Applications

Oracle and JSF

What is JavaServer Faces?

Standard J2EE Web UI framework Developed through Java Community Process (JCP) as JSR-127, JSR-252 Nickname: Faces Started: May 2001 First release: March 2004 Oracle is a primary contributor

slide-3
SLIDE 3

Focus on components, not markup Automatic event and state handling Designed to be leveraged by tools

Goal is to simplify J2EE web application development

Role of Faces

Agenda

Introduction to JavaServer Faces

– What is JavaServer Faces – Goals

Architecture

– Request Lifecycle – JSF Components – Developing JSF Applications

Oracle and JSF

slide-4
SLIDE 4

Servlets JSP JSF

Evolution of J2EE web tier

Each is built on the previous layer Progressive levels of abstraction Higher level programming

JSF Architecture

Abstracts away from HTTP

– Developers don’t need to understand request-

response cycle

Abstracts away from HTML

– Developers work with components, not markup – Developers don’t need to decode requests

slide-5
SLIDE 5

JSF Architecture

HTML render kit

Front Controller Front Controller

WML render kit WML render kit

Backend Backend Code Code

JSF LIFECYCLE

Formal Phases – Initial Request

Restore View Restore View Client / Browser Client / Browser Render Render Response Response

slide-6
SLIDE 6

JSF LIFECYCLE

Formal Phases - Postback

Restore View Restore View Client / Browser Client / Browser Apply Apply Request Request Values Values Update Update Model Model Invoke Invoke Application Application Render Render Response Response Process Process Validation Validation

JSP LIFECYCLE

Formal Phases (cont.) - JSP

Servlet Servlet URL parsing URL parsing Client / Browser Client / Browser Render Render JSP Response JSP Response Product code Product code (state management, (state management, events, etc.) events, etc.)

slide-7
SLIDE 7

JavaServer Faces and JSP

JSF is specified to support JSP

But need not always utilize it Can build your own ViewHandler

JSF JSP support comes with a set of Base UI Component libraries

Core – For application tasks Validation, Datatype conversion HTML – For rendering basic HTML Input fields, menus, tables button Applications Pages UI Components Markup Java Http Requests Ease of Development Lower Level

JSF vs. Traditional JSP

Product UI Events Developer JSF JSF JSP JSP

slide-8
SLIDE 8

JSF Components

Basic building blocks of a JSF application Simple to complex UI components from a button to a complete page Uses Value Binding to associate Model objects Fully Extendable Components include “Helper objects”

– Validators, Converters, PhaseListeners…

JSF Components

The term “JSF Component” generally consists of: UIComponent

– Functionality, definition, or behavior

Renderer

– Handle client side markup – Bundled in RenderKit

UI Component Tag Handler (for JSP)

– Allows usage of JSF component in JSP – Associates Renderer with UI Component

slide-9
SLIDE 9

JSF Application

A typical JSF application consists of: JSP pages

– With JSF components wrapped as JSP tags

Navigation Model

– Defined in the Faces configuration file

Managed Beans

– Application logic

Faces configuration - faces-config.xml D E M O N S T R A T I O N

Developing a JSF Application

slide-10
SLIDE 10

Agenda

Introduction to JavaServer Faces

– What is JavaServer Faces – Goals

Architecture

– Request Lifecycle – JSF Components – Developing JSF Applications

Oracle and JSF

Oracle and JSF

JSF Development in JDeveloper 10.1.3

– Complete visual development environment

for JSF

Oracle ADF Faces

– Oracle’s complementary library of JSF

Components

slide-11
SLIDE 11

JSF and JDeveloper 10.1.3

JSF Visual Editing

– JSF UI Component visual editing – “Autobinding” backing code generation

Option

– Visual design

for mobile clients

JSF and JDeveloper 10.1.3

Faces Config Editing Console

– Console for productive editing of faces-config.xml

slide-12
SLIDE 12

JSF and JDeveloper 10.1.3

JSF Page Flow

– Visually design Faces navigation model

JSF and JDeveloper 10.1.3

Declarative data binding – JSR 227

– Drag and drop data binding support

slide-13
SLIDE 13

ADF Faces - Consistent Programming Model

J2EE J2EE

  • Bus. Logic
  • Bus. Logic

HTML HTML

RIA RIA Mobile Mobile Telnet Telnet

Industrial Industrial XML XML XML XML HTML HTML ITS ITS

Phone/PDA Phone/PDA

Browser Browser Skins Skins Render Kits Render Kits Components Components Interface Interface Java Server Faces / JSP Java Server Faces / JSP Faces RI Faces RI ADF Faces ADF Faces Portal Portal

ASK ASK AS AS

Oracle ADF Faces

A set of standard JSF 1.1 components Runs on any compliant implementation of JSF Over 100 types of components PPR, scrollable and sortable table etc… Rich feature set for customizing applications ADF model support out-of-the-box Look and Feel Customization

slide-14
SLIDE 14

ADF Faces Components

Accessibility and internationalization support across the board Framework features e.g. Dialog framework and support for processes Released early and often – every 4-5 weeks –

  • n OTN

ADF Faces RIA

RIA – Rich Internet Application A Rich Client combining:

– Deployment benefits of a Thin Client

application

– Rich interaction of a desktop application

slide-15
SLIDE 15

ADF Faces RIA

Rich Internet JSF components Leveraging “Ajax” technologies JSF components with live updates in the Browser Popup menus, Trees, Splitters etc…

Multi-client development

slide-16
SLIDE 16

D E M O N S T R A T I O N

Multi-client JSF Application

JSF Web Resources

JSF Reference Implementation

http://java.sun.com/j2ee/javaserverfaces/

JSF Central – Most Popular Online JSF Community

http://jsfcentral.com

Oracle Technology Network JSF Resources

http://otn.oracle.com/jsf

slide-17
SLIDE 17

JSF Books

Summary

Think components, not markup Not just for HTML Framework for both Corporate Developers and Component Developers Built in event and state management Component sets can be provided by any vendor Closer to Swing or ASP.Net development Choice of UI technology

slide-18
SLIDE 18

A Q &

Q U E S T I O N S Q U E S T I O N S A N S W E R S A N S W E R S