overview of jsf 2.0

12
JavaServer™ Faces 2.0 Overview Roger Kitain Enterprise Java Platforms >

Upload: eduardo-pelegri-llopart

Post on 11-May-2015

4.853 views

Category:

Technology


2 download

DESCRIPTION

An Overview of JavaServer Faces 2.0 (JSF 2.0)

TRANSCRIPT

Page 1: Overview of JSF 2.0

JavaServer™ Faces 2.0Overview

• Roger Kitain• Enterprise Java Platforms

>

Page 2: Overview of JSF 2.0

JSF 2.0 – What We Heard• Top Goals

1)Page Declaration Language (PDL)2)Make custom components much easier to develop 3)Ajax Support4)Reduce the configuration burden

Page 3: Overview of JSF 2.0

• Based on Facelets• Facelets:

> first non-JSP PDL designed for JSF> Some differences from JSP:

> Pages compiled to abstract structure - when executed builds JSF component view

> Don't need TLD for tag attributes> Page templating

Page Declaration Language

Page 4: Overview of JSF 2.0

<html xmlns="http://www.w3.org/1999/xhtml" xmlns:h="http://java.sun.com/jsf/html" xmlns:ez="http://java.sun.com/jsf/composite/simpleout">... <h1>Yellow Text Example</h1> <h:form id="form1"> <ez:out value="Test Value"/> <p><h:commandButton value="reload"/></p> </h:form></html>

Easier component Development

Page 5: Overview of JSF 2.0

<html xmlns="http://www.w3.org/1999/xhtml" xmlns:h="http://java.sun.com/jsf/html" xmlns:composite="http://java.sun.com/jsf/composite">...<composite:interface name="out" displayName="Very Basic Output Component"

preferred="true"...> <composite:attribute name="value" required="false"/></composite:interface>

<composite:implementation> <h:outputText value="#{compositeComponent.attrs.value}" style="background-color: yellow"/></composite:implementation></body></html>

Easier component Development

Page 6: Overview of JSF 2.0

• Resource Delivery Mechanism• Partial View Processing• Partial View Rendering• Ajaxification Capability

• Ajax Enabled Components

↑ In JSF 2.0 Spec

↓ In Component Library

R

Ajax Support

Page 7: Overview of JSF 2.0

Ajax Support

Restore View Apply Request Values

Process Validations

RenderResponse

InvokeApplication

Update Model Values

1211

2 3

54

Ajax Request

execute:4,5

4 5 Execute Portion

Partial View Processing

Page 8: Overview of JSF 2.0

Ajax Support

Restore View Apply Request Values

Process Validations

RenderResponse

InvokeApplication

Update Model Values

1211

2 3

54

Ajax Request

render:4,5

4 5

Partial View Processing

Render Portion

Page 9: Overview of JSF 2.0

• JavaScript namespace registered with OpenAjax• JavaScript API for performing Ajax interations with

JSF> collecting/encoding view state> sending requests> processing Ajax response and Dom updates

Ajax Support

Page 10: Overview of JSF 2.0

Ajaxification Capability• A way to give ajax capability to existing JSF

components without writing any JavaScript• Specification will define core tag<h:commandButton value=”submit”>

<f:ajaxRequest render=”myOutput” /></h:commandButton>...<h:outputText id=”myOutput” />

Ajax Support

Page 11: Overview of JSF 2.0

Annotation Support• An alternative to XML configuration • @FacesComponent, @FacesConverter, @ManagedBean• “Scope” Annotations:

> @RequestScope, @SessionScope, @ApplicationScope

Reduce Configuration Burden

Page 12: Overview of JSF 2.0

• Collected feedback from community and EG members• Defined top goals for specification• Diverse set of EG members

Summary