overview of jsf 2.0
DESCRIPTION
An Overview of JavaServer Faces 2.0 (JSF 2.0)TRANSCRIPT
JavaServer™ Faces 2.0Overview
• Roger Kitain• Enterprise Java Platforms
>
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
• 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
<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
<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
• 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
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
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
• 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
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
Annotation Support• An alternative to XML configuration • @FacesComponent, @FacesConverter, @ManagedBean• “Scope” Annotations:
> @RequestScope, @SessionScope, @ApplicationScope
Reduce Configuration Burden
• Collected feedback from community and EG members• Defined top goals for specification• Diverse set of EG members
Summary