SlideShare una empresa de Scribd logo
1 de 67
Descargar para leer sin conexión
JSF 2: myth or panacea?
Magic world of user
interfaces

Сергей Моренец
29 августа 2012 г.
Agenda
•
•
•
•
•

The history of Java Web frameworks
JSF specification and roadmap
JSF plugins and extensions
Custom components design
Q&A
Distributed App UI History
Imagination
Reality
The history of Java Web
frameworks
The Servlet API
• The introduction in March 1998
• Enabled Java developers to write server-side code for
delivering dynamic Web content
• Java response to CGI
JavaServer Pages
•
•
•
•
•

Released in 1999 by Sun Microsystems
High-level abstraction of Java servlets
Java response to PHP
Adds tags and expression language
Works inside JSP container, which handles all JSP page
view requests.
Apache Struts
•
•
•
•
•

Introduced by Apache Foundation in 2000
Implementation of the Model-View-Controller paradigm
Enabled actions to support navigation
Templates in JSP, XML, Velocity
Struts 2 with AJAX and plugins support
Spring MVC
•
•
•
•
•

Released under Apache 2.0 license in 2003
Spring response to Struts framework
Tightly coupled to the Spring IOC container
Defines strategy interfaces for the responsibilities
Supports portlet development
The Birth of JSF
• Created as JSR #127
• Designed by Sun, Oracle, IBM and BEA in May 2001
• J2EE framework for building Web applications
The JSF Design Goals
• Create a standard UI component framework
• Define a set of lightweight Java classes for UI
components, component state, and input events
• Provide a set of common UI components
• Provide a JavaBeans model for dispatching events from
client-side UI controls to server-side application behavior
The JSF Design Goals
• Define APIs for input validation, including client-side
validation
• Specify a model for internationalization and localization
• Automatic support of all available client configuration
data, such as the browser version
• Support Web Accessibility Initiative (WAI)
History of JSF
• Simple things should be simple. Complex things
should be possible.
Alan Kay
JSF 1.0
• Initial release in March 2004
• Core and performance improvement
• Supports Servlet 2.3 and JSP 1.2
JSF 1.1
• Bugfix release in May 2004
• Performance issues
• Based on J2EE 1.3
JSF 1.2
•
•
•
•
•

Release in May 2006
Fully detached from JSP as view technology
Unified expression language support
Lack of Ajax out-of-box support
Core part of J2EE 5
JSF 2.0
Release in June 2009
JSP replaced by facelets as view technology
Full Ajax support similar to Ajax4jsf
Annotations and convention-over-configuration
invention
• New conversation scope
•
•
•
•
JSF Sample Page
•
•
•
•
•
•
•
•
•
•
•
•
•
•

<html xmlns=http://www.w3.org/1999/xhtml
xmlns:h=http://java.sun.com/jsf/html
xmlns:f="http://java.sun.com/jsf/core">
<h:body>
<h:form>
<h2>A Simple JSF Page</h2>
<h:outputText value="#{modelBean.currentDate}">
<f:convertDateTime type="both"
timeZone="#{userLocale.timeZone}" />
</h:outputText>
<h:inputText value="#{modelBean.username}"/>
<h:commandButton value="Click Here"/>
</h:form>
</h:body>
</html>
ModelBean.java
public class ModelBean {
private Date currentDate;
private String username;
public Date getCurrentDate() {
return currentDate;
}
public void setCurrentDate(Date currentDate) {
this.currentDate = currentDate;
}
public String getUsername() {
return username;
}

public void setUsername(String username) {
this.username = username;
}
}
Configuration file
•
•
•
•
•
•
•
•
•
•
•

•
•
•
•

<?xml version="1.0" encoding="UTF-8"?>
<faces-config xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/web-facesconfig_2_0.xsd"
version="2.0">
<application>
<message-bundle>message</message-bundle>
</application>
<managed-bean>
<managed-bean-name>modelBean</managedbean-name>
<managed-beanclass>org.mycompany.ModelBean</managed-bean-class>
<managed-bean-scope>session</managed-beanscope>
</managed-bean>
</faces-config>
Component Rendering
Component LifeCycle
Built on JavaBeans
concepts
• UIComponent hierarchy
Properties
Methods
Events
Validators
Convertors
• Event model
Listener classes
Event objects
• Page navigation
JSF Implementations

• Oracle reference
implementation
• Sub-project of Glassfish

• UI widgets (MyFaces Tomahawk,
MyFaces Trinidad, MyFaces
Tobago)
• Extension packages to (MyFaces
Orchestra, MyFaces Extensions
Validator, MyFaces Extensions
CDI)
• Integration modules ( MyFaces
Portlet Bridge)
Mojarra vs. MyFaces performance
Testcase

MyFaces (ms)

Mojarra(ms)

1. JSF Protocol Tests

239

207

2. Full Body
Replacement

42

35

4134

4426

24

34

5. Double Eval
Detection

2047

2060

6. Table Test,
replacement of table
elements

7289

9229

6. Partial Page
Rendering Nav Case

2168

2308

7. Event Lifecycle test

130

131

3. Multi form situation
4. Testing for
decorated api calls
Ajax-enabled components and
frameworks
•

•
•
•
•
•
•
•
•

jBoss RichFaces, Ajax-enabled JSF components for layout, file
upload, forms, inputs and many other features.
ICEfaces, open-source, Java JSF extension framework and rich
components, Ajax without JavaScript
PrimeFaces Ajax framework with JSF components
Oracle ADF Faces Rich Client, Oracle Application Development
Framework
Backbase Enterprise Ajax — JSF Edition, Ajax framework
IBM Lotus Notes - XPages
MyFaces, The Apache Foundation JSF implementation with Ajax
components
Sun Java BluePrints AJAX Components
ZK Ajax framework with JSF components
RichFaces 4
•
•
•
•

•
•

•
•

A full set of AJAX enabled components
Client-side validation
Advanced queuing
Push component upgrades including
JavaMessaging Service (JMS) integrations
Component Development Kit (CDK).
Comprehensive documentation covering
development best practices, and component
details.
Detailed and automated testing facilities for
components, actions, listeners, and pages.
Broad cross-browser support
RichFaces Components
• Ajax4JSF
• RichFaces
Ajax4JSF
• Core Ajax functionality
• Page-level Ajax support
• Utility components
Rich components
• Self-contained and advanced UI components
• Extension of standard JSF components
• Pluggable customization though Ajax support
A Historical Perspective
• Created as Telamon project in 2005 by Alexander
Smirnov
• Released in 2006 as part of Exadel Visual
Component Platform
• Split into open-source Ajax4jsf and commercial
RichFaces in 2006
• Made open-source in 2007 as Jboss Ajax4jsf and
Jboss RichFaces
• Merged as single RichFaces product in September
2007
Alexander Smirnov
• Architect of the Jboss Richfaces project
• Java Server Faces expert group member
• Jboss GateIn portal developer
RichFaces Team
Client Side Validation
Data Table
Popup Panel
Data Grid
Tree
Rich Editor
Pick List
Push
RichFaces Push
•
•
•
•

Server-side push technique
Based on Atmosphere framework
Client-side support(Comet, HTML5 WebSockets)
Integration with Java Messaging Service
RichBean.java
• public Date getDate() {
•
return new Date();
• }
•
• public void push() throws MessageException {
•
TopicKey topicKey = new TopicKey("sampleAddress");
•
TopicsContext topicsContext =
TopicsContext.lookup();
•
•
topicsContext.publish(topicKey, "empty message");
• }
Index.html
• <a4j:commandButton value="Push!"
action="#{richBean.push}" />
•
• <a4j:push address="sampleAddress">
•
<a4j:ajax event="dataavailable"
render="outputDate" />
• </a4j:push>
•
• <a4j:outputPanel id="outputDate">
•
Date: #{richBean.date}
• </a4j:outputPanel>
Custom components
design in JSF 1.2
AdvancedDateComponent.java
• public class AdvancedDateComponent extends
UIComponentBase {
•
private HtmlSelectOneMenu dayCmb;
•
private HtmlSelectOneMenu monthCmb;
•
private HtmlSelectOneMenu yearCmb;
•
•
•
•

@Override
public String getFamily() {
return "advanced.Date";
}

•
•
•
•
•

@Override
public String getRendererType() {
return "renderer.advanced.Date";
}
AdvancedDateComponent.java
public Object getValue() {
ValueExpression _ve = getValueExpression("value");
return (_ve != null) ? _ve.getValue(getFacesContext().getELContext()) : null;
}
public void setSubmittedValue(FacesContext context) {
Map<String, String> requestParameterValuesMap = context.getExternalContext().
getRequestParameterMap();
String day = requestParameterValuesMap.get(dayCmb.getClientId(context));
String month =
requestParameterValuesMap.get(monthCmb.getClientId(context));
String year = requestParameterValuesMap.get(yearCmb.getClientId(context));
Calendar calendar = Calendar.getInstance();
calendar.set(Integer.valueOf(year), Integer.valueOf(month) - 1,
Integer.valueOf(day));

}

ValueExpression ve = getValueExpression(“value”);
ve.setValue(getFacesContext().getELContext(), calendar.getTime());
AdvancedDateRenderer.java
• public class AdvancedDateRenderer extends Renderer{
•
•
•
•
•
•
•
•

@Override
public void encodeBegin(FacesContext
context, UIComponent
component) throws IOException {
if(component instanceof AdvancedDateComponent)
{
CompositeDateComponent dateComponent =
(CompositeDateComponent)component;
dateComponent.refresh();
dateComponent.updateComponents();
}
AdvancedDateRenderer.java
• @Override
• public void decode(FacesContext context,
• UIComponent component) {
• if (component instanceof
AdvancedDateComponent) {
• AdvancedDateComponent dateComponent =
(AdvancedDateComponent) component;
• dateComponent.refresh();
• dateComponent.setSubmittedValue(context);
• }}}
Configuration file
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•

<?xml version="1.0" encoding="UTF-8"?>
<faces-config xmlns="http://java.sun.com/xml/ns/javaee">
<component>
<display-name>advancedDate</display-name>
<component-type>advanced.Date</component-type>
<component-class>org.test.component.AdvancedDateComponent
</component-class>
<component-extension>
<renderer-type>renderer.advanced.Date</renderer-type>
</component-extension>
</component>
<render-kit>
<renderer>
<component-family>advanced.Date</component-family>
<renderer-type>renderer.advanced.Date</renderer-type>
<renderer-class>org.test.component.AdvancedDateRenderer</rendererclass>
</renderer>
</render-kit>
</faces-config>
Tag configuration file
• <?xml version="1.0"?>
• <facelet-taglib xmlns="http://java.sun.com/JSF/Facelet">
• <namespace>http://test.org/web/tags</namespace>
<tag>
<tag-name>advancedDate</tag-name>
<component>
<componenttype>advanced.Date</component-type>
•
<renderertype>renderer.advanced.Date</renderer-type>
•
</component>
•
</tag>
•
•
•
•

• </facelet-taglib>
account.xhtml
<ui:composition
xmlns="http://www.w3.org/1999/xhtml"
xmlns:ui=http://java.sun.com/jsf/facelets
xmlns:h="http://java.sun.com/jsf/html"
xmlns:web="http://test.org/web/tags">

<h:outputText value="#{msg['account.birthdate']}" />
<web:compositeDate value=“#{account.birthDate}"
/>
</ui:composition>
Custom components
design in JSF 2.0
Custom components
•
•
•
•

No configuration, XML or otherwise.
No Java code.
To which developers can attach functionality.
Hot-deploy.
compositeDate.xhtml
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:cc="http://java.sun.com/jsf/composite">
<cc:interface>
<cc:attribute name="birthDate"
shortDescription="Value of the component" />
<cc:attribute name="days"
shortDescription="List of SelectItem objects representing days" />
<cc:attribute name="months"
shortDescription="List of SelectItem objects representing months"
/>
<cc:attribute name="years"
shortDescription="List of SelectItem objects representing years"
/>
</cc:interface>
compositeDate.xhtml
<cc:implementation>
<h:panelGrid columns="3">
<h:selectOneMenu value="#{date.day}">
<f:selectItems value="#{days}" />
</h:selectOneMenu>
<h:selectOneMenu value="#{date.month}">
<f:selectItems value="#{months}" />
</h:selectOneMenu>
<h:selectOneMenu value="#{date.year}">
<f:selectItems value="#{years}" />
</h:selectOneMenu>
</h:panelGrid>
</cc:implementation>
</html>
account.xhtml
<ui:composition
xmlns="http://www.w3.org/1999/xhtml"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:tr="http://java.sun.com/jsf/composite/trai
ner">
<h:outputText value="#{msg['account.birthdate']}" />
<tr:compositeDate date=“#{account.birthDate}"
days="#{days}" months="months" years="#{years}" />

</ui:composition>
Disadvantages
Jobs at dice.com
StackOverflow tagged questions
•
•
•
•
•
•

High level of understanding
Limited community support
Lack of books and comprehensive documentation
Multiple resource-consuming dependencies
Performance overhead
Migration issues between RF3 and RF4
Love bug story
• I am migrating from RF 3.3.1 to 4.0. I'm experiencing
an issue with the tooltip component. Specifying
"bottom-left" for the direction attribute results in the
following error:
• javax.el.ELException: Cannot convert bottom-left of
type class java.lang.String to class
org.richfaces.component.Positioning
• Was this attribute implemented in 4.0? Am I doing
something wrong?
Love bug story
• Just in case someone else has the same issue, I've
figured it out. In RF 4, 'bottom-right' positioning is no
longer valid. You have to use 'bottomRight'. I am
completely shocked that none of these changes have
made it to their online documentation. I have wasted
time trying to figure out what was happening with this
component. I cannot believe users are expected to go
to the API JavaDocs and look through each class for
possible attribute values.
•
• If any RichFaces guys read this, please either update the
online documentation or remove it. There are way too
many components in there with information that has not
been updated and is just plain wrong
Q&A

• Сергей Моренец, morenets@mail.ru

Más contenido relacionado

La actualidad más candente

Pitfalls of Migrating to SharePoint 2010
Pitfalls of Migrating to SharePoint 2010Pitfalls of Migrating to SharePoint 2010
Pitfalls of Migrating to SharePoint 2010Dan Usher
 
04 asp.net session05
04 asp.net session0504 asp.net session05
04 asp.net session05Niit Care
 
Laravel and CodeIgniter: pros & cons
Laravel and CodeIgniter: pros & consLaravel and CodeIgniter: pros & cons
Laravel and CodeIgniter: pros & consElenorWisozk
 
Introduction to Alfresco Surf Platform
Introduction to Alfresco Surf PlatformIntroduction to Alfresco Surf Platform
Introduction to Alfresco Surf PlatformAlfresco Software
 
The future of web development write once, run everywhere with angular js an...
The future of web development   write once, run everywhere with angular js an...The future of web development   write once, run everywhere with angular js an...
The future of web development write once, run everywhere with angular js an...Mark Leusink
 
Sharepoint as a service platform
Sharepoint as a service platformSharepoint as a service platform
Sharepoint as a service platformKashif Akram
 
Developing modular Java applications
Developing modular Java applicationsDeveloping modular Java applications
Developing modular Java applicationsJulien Dubois
 
Best Practices Configuring And Developing Share Point Solutions
Best Practices Configuring And Developing Share Point SolutionsBest Practices Configuring And Developing Share Point Solutions
Best Practices Configuring And Developing Share Point SolutionsAlexander Meijers
 
Develop business apps cross-platform development using visual studio with x...
Develop business apps   cross-platform development using visual studio with x...Develop business apps   cross-platform development using visual studio with x...
Develop business apps cross-platform development using visual studio with x...Alexander Meijers
 
Netbeans 6.1 Talk
Netbeans 6.1 TalkNetbeans 6.1 Talk
Netbeans 6.1 TalkAngad Singh
 
Tarabica 2019 - Migration from ASP.NET MVC to ASP.NET Core
Tarabica 2019 - Migration from ASP.NET MVC to ASP.NET CoreTarabica 2019 - Migration from ASP.NET MVC to ASP.NET Core
Tarabica 2019 - Migration from ASP.NET MVC to ASP.NET CoreMiroslav Popovic
 
WCM Roadmap Versions 3 3 And 4 0
WCM Roadmap Versions 3 3 And 4 0WCM Roadmap Versions 3 3 And 4 0
WCM Roadmap Versions 3 3 And 4 0Alfresco Software
 
JDK 8 and JDK 8 Updates in OpenJDK
JDK 8 and JDK 8 Updates in OpenJDKJDK 8 and JDK 8 Updates in OpenJDK
JDK 8 and JDK 8 Updates in OpenJDKWolfgang Weigend
 
Php apache vs iis By Hafedh Yahmadi
Php apache vs iis  By Hafedh YahmadiPhp apache vs iis  By Hafedh Yahmadi
Php apache vs iis By Hafedh YahmadiTechdaysTunisia
 
Access share point-2013-data-with-provider-hosted-apps
Access share point-2013-data-with-provider-hosted-appsAccess share point-2013-data-with-provider-hosted-apps
Access share point-2013-data-with-provider-hosted-appsAlexander Meijers
 

La actualidad más candente (20)

Pitfalls of Migrating to SharePoint 2010
Pitfalls of Migrating to SharePoint 2010Pitfalls of Migrating to SharePoint 2010
Pitfalls of Migrating to SharePoint 2010
 
Java modules
Java modulesJava modules
Java modules
 
04 asp.net session05
04 asp.net session0504 asp.net session05
04 asp.net session05
 
yii framework
yii frameworkyii framework
yii framework
 
Laravel and CodeIgniter: pros & cons
Laravel and CodeIgniter: pros & consLaravel and CodeIgniter: pros & cons
Laravel and CodeIgniter: pros & cons
 
Introduction to Alfresco Surf Platform
Introduction to Alfresco Surf PlatformIntroduction to Alfresco Surf Platform
Introduction to Alfresco Surf Platform
 
The future of web development write once, run everywhere with angular js an...
The future of web development   write once, run everywhere with angular js an...The future of web development   write once, run everywhere with angular js an...
The future of web development write once, run everywhere with angular js an...
 
Sharepoint as a service platform
Sharepoint as a service platformSharepoint as a service platform
Sharepoint as a service platform
 
Developing modular Java applications
Developing modular Java applicationsDeveloping modular Java applications
Developing modular Java applications
 
Best Practices Configuring And Developing Share Point Solutions
Best Practices Configuring And Developing Share Point SolutionsBest Practices Configuring And Developing Share Point Solutions
Best Practices Configuring And Developing Share Point Solutions
 
Develop business apps cross-platform development using visual studio with x...
Develop business apps   cross-platform development using visual studio with x...Develop business apps   cross-platform development using visual studio with x...
Develop business apps cross-platform development using visual studio with x...
 
Netbeans 6.1 Talk
Netbeans 6.1 TalkNetbeans 6.1 Talk
Netbeans 6.1 Talk
 
Tarabica 2019 - Migration from ASP.NET MVC to ASP.NET Core
Tarabica 2019 - Migration from ASP.NET MVC to ASP.NET CoreTarabica 2019 - Migration from ASP.NET MVC to ASP.NET Core
Tarabica 2019 - Migration from ASP.NET MVC to ASP.NET Core
 
WCM Roadmap Versions 3 3 And 4 0
WCM Roadmap Versions 3 3 And 4 0WCM Roadmap Versions 3 3 And 4 0
WCM Roadmap Versions 3 3 And 4 0
 
JDK 8 and JDK 8 Updates in OpenJDK
JDK 8 and JDK 8 Updates in OpenJDKJDK 8 and JDK 8 Updates in OpenJDK
JDK 8 and JDK 8 Updates in OpenJDK
 
JEE 8, A Big Overview
JEE 8, A Big OverviewJEE 8, A Big Overview
JEE 8, A Big Overview
 
JavaEE 6 tools coverage
JavaEE 6 tools coverageJavaEE 6 tools coverage
JavaEE 6 tools coverage
 
Php apache vs iis By Hafedh Yahmadi
Php apache vs iis  By Hafedh YahmadiPhp apache vs iis  By Hafedh Yahmadi
Php apache vs iis By Hafedh Yahmadi
 
Access share point-2013-data-with-provider-hosted-apps
Access share point-2013-data-with-provider-hosted-appsAccess share point-2013-data-with-provider-hosted-apps
Access share point-2013-data-with-provider-hosted-apps
 
Spring
SpringSpring
Spring
 

Destacado

Effective Java applications
Effective Java applicationsEffective Java applications
Effective Java applicationsStrannik_2013
 
Effectiveness and code optimization in Java
Effectiveness and code optimization in JavaEffectiveness and code optimization in Java
Effectiveness and code optimization in JavaStrannik_2013
 
Getting ready to java 8
Getting ready to java 8Getting ready to java 8
Getting ready to java 8Strannik_2013
 
Gradle.Enemy at the gates
Gradle.Enemy at the gatesGradle.Enemy at the gates
Gradle.Enemy at the gatesStrannik_2013
 
Java 8 in action.Jinq
Java 8 in action.JinqJava 8 in action.Jinq
Java 8 in action.JinqStrannik_2013
 
Gradle 2.Write once, builde everywhere
Gradle 2.Write once, builde everywhereGradle 2.Write once, builde everywhere
Gradle 2.Write once, builde everywhereStrannik_2013
 
Gradle 2.Breaking stereotypes
Gradle 2.Breaking stereotypesGradle 2.Breaking stereotypes
Gradle 2.Breaking stereotypesStrannik_2013
 
Top 10 reasons to migrate to Gradle
Top 10 reasons to migrate to GradleTop 10 reasons to migrate to Gradle
Top 10 reasons to migrate to GradleStrannik_2013
 
Git.From thorns to the stars
Git.From thorns to the starsGit.From thorns to the stars
Git.From thorns to the starsStrannik_2013
 
Spring Web flow. A little flow of happiness
Spring Web flow. A little flow of happinessSpring Web flow. A little flow of happiness
Spring Web flow. A little flow of happinessStrannik_2013
 
Spring Boot. Boot up your development
Spring Boot. Boot up your developmentSpring Boot. Boot up your development
Spring Boot. Boot up your developmentStrannik_2013
 
Spring Web Flow. A little flow of happiness.
Spring Web Flow. A little flow of happiness.Spring Web Flow. A little flow of happiness.
Spring Web Flow. A little flow of happiness.Alex Tumanoff
 
Serialization and performance in Java
Serialization and performance in JavaSerialization and performance in Java
Serialization and performance in JavaStrannik_2013
 
Spring Boot. Boot up your development. JEEConf 2015
Spring Boot. Boot up your development. JEEConf 2015Spring Boot. Boot up your development. JEEConf 2015
Spring Boot. Boot up your development. JEEConf 2015Strannik_2013
 
Spring.Boot up your development
Spring.Boot up your developmentSpring.Boot up your development
Spring.Boot up your developmentStrannik_2013
 
Junior,middle,senior?
Junior,middle,senior?Junior,middle,senior?
Junior,middle,senior?Strannik_2013
 
JEEConf 2016. Effectiveness and code optimization in Java applications
JEEConf 2016. Effectiveness and code optimization in  Java applicationsJEEConf 2016. Effectiveness and code optimization in  Java applications
JEEConf 2016. Effectiveness and code optimization in Java applicationsStrannik_2013
 

Destacado (17)

Effective Java applications
Effective Java applicationsEffective Java applications
Effective Java applications
 
Effectiveness and code optimization in Java
Effectiveness and code optimization in JavaEffectiveness and code optimization in Java
Effectiveness and code optimization in Java
 
Getting ready to java 8
Getting ready to java 8Getting ready to java 8
Getting ready to java 8
 
Gradle.Enemy at the gates
Gradle.Enemy at the gatesGradle.Enemy at the gates
Gradle.Enemy at the gates
 
Java 8 in action.Jinq
Java 8 in action.JinqJava 8 in action.Jinq
Java 8 in action.Jinq
 
Gradle 2.Write once, builde everywhere
Gradle 2.Write once, builde everywhereGradle 2.Write once, builde everywhere
Gradle 2.Write once, builde everywhere
 
Gradle 2.Breaking stereotypes
Gradle 2.Breaking stereotypesGradle 2.Breaking stereotypes
Gradle 2.Breaking stereotypes
 
Top 10 reasons to migrate to Gradle
Top 10 reasons to migrate to GradleTop 10 reasons to migrate to Gradle
Top 10 reasons to migrate to Gradle
 
Git.From thorns to the stars
Git.From thorns to the starsGit.From thorns to the stars
Git.From thorns to the stars
 
Spring Web flow. A little flow of happiness
Spring Web flow. A little flow of happinessSpring Web flow. A little flow of happiness
Spring Web flow. A little flow of happiness
 
Spring Boot. Boot up your development
Spring Boot. Boot up your developmentSpring Boot. Boot up your development
Spring Boot. Boot up your development
 
Spring Web Flow. A little flow of happiness.
Spring Web Flow. A little flow of happiness.Spring Web Flow. A little flow of happiness.
Spring Web Flow. A little flow of happiness.
 
Serialization and performance in Java
Serialization and performance in JavaSerialization and performance in Java
Serialization and performance in Java
 
Spring Boot. Boot up your development. JEEConf 2015
Spring Boot. Boot up your development. JEEConf 2015Spring Boot. Boot up your development. JEEConf 2015
Spring Boot. Boot up your development. JEEConf 2015
 
Spring.Boot up your development
Spring.Boot up your developmentSpring.Boot up your development
Spring.Boot up your development
 
Junior,middle,senior?
Junior,middle,senior?Junior,middle,senior?
Junior,middle,senior?
 
JEEConf 2016. Effectiveness and code optimization in Java applications
JEEConf 2016. Effectiveness and code optimization in  Java applicationsJEEConf 2016. Effectiveness and code optimization in  Java applications
JEEConf 2016. Effectiveness and code optimization in Java applications
 

Similar a JSF 2: Myth of panacea? Magic world of user interfaces

Utilizing JSF Front Ends with Microservices
Utilizing JSF Front Ends with MicroservicesUtilizing JSF Front Ends with Microservices
Utilizing JSF Front Ends with MicroservicesJosh Juneau
 
RichFaces 4 Component Deep Dive - JAX/JSFSummit
RichFaces 4 Component Deep Dive - JAX/JSFSummitRichFaces 4 Component Deep Dive - JAX/JSFSummit
RichFaces 4 Component Deep Dive - JAX/JSFSummitbalunasj
 
Ajax Applications with JSF2 and New RichFaces 4 at JAX 2011
Ajax Applications with JSF2 and New RichFaces 4 at JAX 2011Ajax Applications with JSF2 and New RichFaces 4 at JAX 2011
Ajax Applications with JSF2 and New RichFaces 4 at JAX 2011Max Katz
 
Ajax Applications with JSF 2 and New RichFaces 4 - CONFESS 2011
Ajax Applications with JSF 2 and New RichFaces 4 - CONFESS 2011Ajax Applications with JSF 2 and New RichFaces 4 - CONFESS 2011
Ajax Applications with JSF 2 and New RichFaces 4 - CONFESS 2011Max Katz
 
Java EE 7 Soup to Nuts at JavaOne 2014
Java EE 7 Soup to Nuts at JavaOne 2014Java EE 7 Soup to Nuts at JavaOne 2014
Java EE 7 Soup to Nuts at JavaOne 2014Arun Gupta
 
SoCal Code Camp 2011 - ASP.NET MVC 4
SoCal Code Camp 2011 - ASP.NET MVC 4SoCal Code Camp 2011 - ASP.NET MVC 4
SoCal Code Camp 2011 - ASP.NET MVC 4Jon Galloway
 
RichFaces 4 webinar #1: Everything You Need To Know
RichFaces 4 webinar #1: Everything You Need To KnowRichFaces 4 webinar #1: Everything You Need To Know
RichFaces 4 webinar #1: Everything You Need To KnowMax Katz
 
Ajax Applications with JSF 2 and New RichFaces 4 - JAX/JSF Summit
Ajax Applications with JSF 2 and New RichFaces 4 - JAX/JSF SummitAjax Applications with JSF 2 and New RichFaces 4 - JAX/JSF Summit
Ajax Applications with JSF 2 and New RichFaces 4 - JAX/JSF SummitMax Katz
 
Ajax Applications with JSF 2 and New RichFaces 4 - TSSJS
Ajax Applications with JSF 2 and New RichFaces 4 - TSSJSAjax Applications with JSF 2 and New RichFaces 4 - TSSJS
Ajax Applications with JSF 2 and New RichFaces 4 - TSSJSMax Katz
 
SYED_DANISH_J2EE_8YRs
SYED_DANISH_J2EE_8YRsSYED_DANISH_J2EE_8YRs
SYED_DANISH_J2EE_8YRsdanish ali
 
Overview of Java EE 6 by Roberto Chinnici at SFJUG
Overview of Java EE 6 by Roberto Chinnici at SFJUGOverview of Java EE 6 by Roberto Chinnici at SFJUG
Overview of Java EE 6 by Roberto Chinnici at SFJUGMarakana Inc.
 
WebNetConf 2012 - Single Page Apps
WebNetConf 2012 - Single Page AppsWebNetConf 2012 - Single Page Apps
WebNetConf 2012 - Single Page AppsPop Apps
 
Structured web apps
Structured web appsStructured web apps
Structured web appsSheng Tian
 
ASP.NET Presentation
ASP.NET PresentationASP.NET Presentation
ASP.NET Presentationdimuthu22
 
Build 2017 - Whats new for Xamarin Devs
Build 2017 - Whats new for Xamarin DevsBuild 2017 - Whats new for Xamarin Devs
Build 2017 - Whats new for Xamarin DevsMike James
 
Java EE 6, Eclipse @ EclipseCon
Java EE 6, Eclipse @ EclipseConJava EE 6, Eclipse @ EclipseCon
Java EE 6, Eclipse @ EclipseConLudovic Champenois
 
LatJUG. JSF2.0 - The JavaEE6 Standard
LatJUG. JSF2.0 - The JavaEE6 StandardLatJUG. JSF2.0 - The JavaEE6 Standard
LatJUG. JSF2.0 - The JavaEE6 Standarddenis Udod
 

Similar a JSF 2: Myth of panacea? Magic world of user interfaces (20)

JSF2
JSF2JSF2
JSF2
 
Utilizing JSF Front Ends with Microservices
Utilizing JSF Front Ends with MicroservicesUtilizing JSF Front Ends with Microservices
Utilizing JSF Front Ends with Microservices
 
Showcase_Intern
Showcase_InternShowcase_Intern
Showcase_Intern
 
RichFaces 4 Component Deep Dive - JAX/JSFSummit
RichFaces 4 Component Deep Dive - JAX/JSFSummitRichFaces 4 Component Deep Dive - JAX/JSFSummit
RichFaces 4 Component Deep Dive - JAX/JSFSummit
 
Ajax Applications with JSF2 and New RichFaces 4 at JAX 2011
Ajax Applications with JSF2 and New RichFaces 4 at JAX 2011Ajax Applications with JSF2 and New RichFaces 4 at JAX 2011
Ajax Applications with JSF2 and New RichFaces 4 at JAX 2011
 
Ajax Applications with JSF 2 and New RichFaces 4 - CONFESS 2011
Ajax Applications with JSF 2 and New RichFaces 4 - CONFESS 2011Ajax Applications with JSF 2 and New RichFaces 4 - CONFESS 2011
Ajax Applications with JSF 2 and New RichFaces 4 - CONFESS 2011
 
Javafx
JavafxJavafx
Javafx
 
Java EE 7 Soup to Nuts at JavaOne 2014
Java EE 7 Soup to Nuts at JavaOne 2014Java EE 7 Soup to Nuts at JavaOne 2014
Java EE 7 Soup to Nuts at JavaOne 2014
 
SoCal Code Camp 2011 - ASP.NET MVC 4
SoCal Code Camp 2011 - ASP.NET MVC 4SoCal Code Camp 2011 - ASP.NET MVC 4
SoCal Code Camp 2011 - ASP.NET MVC 4
 
RichFaces 4 webinar #1: Everything You Need To Know
RichFaces 4 webinar #1: Everything You Need To KnowRichFaces 4 webinar #1: Everything You Need To Know
RichFaces 4 webinar #1: Everything You Need To Know
 
Ajax Applications with JSF 2 and New RichFaces 4 - JAX/JSF Summit
Ajax Applications with JSF 2 and New RichFaces 4 - JAX/JSF SummitAjax Applications with JSF 2 and New RichFaces 4 - JAX/JSF Summit
Ajax Applications with JSF 2 and New RichFaces 4 - JAX/JSF Summit
 
Ajax Applications with JSF 2 and New RichFaces 4 - TSSJS
Ajax Applications with JSF 2 and New RichFaces 4 - TSSJSAjax Applications with JSF 2 and New RichFaces 4 - TSSJS
Ajax Applications with JSF 2 and New RichFaces 4 - TSSJS
 
SYED_DANISH_J2EE_8YRs
SYED_DANISH_J2EE_8YRsSYED_DANISH_J2EE_8YRs
SYED_DANISH_J2EE_8YRs
 
Overview of Java EE 6 by Roberto Chinnici at SFJUG
Overview of Java EE 6 by Roberto Chinnici at SFJUGOverview of Java EE 6 by Roberto Chinnici at SFJUG
Overview of Java EE 6 by Roberto Chinnici at SFJUG
 
WebNetConf 2012 - Single Page Apps
WebNetConf 2012 - Single Page AppsWebNetConf 2012 - Single Page Apps
WebNetConf 2012 - Single Page Apps
 
Structured web apps
Structured web appsStructured web apps
Structured web apps
 
ASP.NET Presentation
ASP.NET PresentationASP.NET Presentation
ASP.NET Presentation
 
Build 2017 - Whats new for Xamarin Devs
Build 2017 - Whats new for Xamarin DevsBuild 2017 - Whats new for Xamarin Devs
Build 2017 - Whats new for Xamarin Devs
 
Java EE 6, Eclipse @ EclipseCon
Java EE 6, Eclipse @ EclipseConJava EE 6, Eclipse @ EclipseCon
Java EE 6, Eclipse @ EclipseCon
 
LatJUG. JSF2.0 - The JavaEE6 Standard
LatJUG. JSF2.0 - The JavaEE6 StandardLatJUG. JSF2.0 - The JavaEE6 Standard
LatJUG. JSF2.0 - The JavaEE6 Standard
 

Último

The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...Wes McKinney
 
A Framework for Development in the AI Age
A Framework for Development in the AI AgeA Framework for Development in the AI Age
A Framework for Development in the AI AgeCprime
 
React Native vs Ionic - The Best Mobile App Framework
React Native vs Ionic - The Best Mobile App FrameworkReact Native vs Ionic - The Best Mobile App Framework
React Native vs Ionic - The Best Mobile App FrameworkPixlogix Infotech
 
Potential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsPotential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsRavi Sanghani
 
Infrared simulation and processing on Nvidia platforms
Infrared simulation and processing on Nvidia platformsInfrared simulation and processing on Nvidia platforms
Infrared simulation and processing on Nvidia platformsYoss Cohen
 
Top 10 Hubspot Development Companies in 2024
Top 10 Hubspot Development Companies in 2024Top 10 Hubspot Development Companies in 2024
Top 10 Hubspot Development Companies in 2024TopCSSGallery
 
Accelerating Enterprise Software Engineering with Platformless
Accelerating Enterprise Software Engineering with PlatformlessAccelerating Enterprise Software Engineering with Platformless
Accelerating Enterprise Software Engineering with PlatformlessWSO2
 
Microsoft 365 Copilot: How to boost your productivity with AI – Part two: Dat...
Microsoft 365 Copilot: How to boost your productivity with AI – Part two: Dat...Microsoft 365 Copilot: How to boost your productivity with AI – Part two: Dat...
Microsoft 365 Copilot: How to boost your productivity with AI – Part two: Dat...Nikki Chapple
 
Email Marketing Automation for Bonterra Impact Management (fka Social Solutio...
Email Marketing Automation for Bonterra Impact Management (fka Social Solutio...Email Marketing Automation for Bonterra Impact Management (fka Social Solutio...
Email Marketing Automation for Bonterra Impact Management (fka Social Solutio...Jeffrey Haguewood
 
Microservices, Docker deploy and Microservices source code in C#
Microservices, Docker deploy and Microservices source code in C#Microservices, Docker deploy and Microservices source code in C#
Microservices, Docker deploy and Microservices source code in C#Karmanjay Verma
 
Modern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better StrongerModern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better Strongerpanagenda
 
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...panagenda
 
Decarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a realityDecarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a realityIES VE
 
Manual 508 Accessibility Compliance Audit
Manual 508 Accessibility Compliance AuditManual 508 Accessibility Compliance Audit
Manual 508 Accessibility Compliance AuditSkynet Technologies
 
2024 April Patch Tuesday
2024 April Patch Tuesday2024 April Patch Tuesday
2024 April Patch TuesdayIvanti
 
Varsha Sewlal- Cyber Attacks on Critical Critical Infrastructure
Varsha Sewlal- Cyber Attacks on Critical Critical InfrastructureVarsha Sewlal- Cyber Attacks on Critical Critical Infrastructure
Varsha Sewlal- Cyber Attacks on Critical Critical Infrastructureitnewsafrica
 
A Glance At The Java Performance Toolbox
A Glance At The Java Performance ToolboxA Glance At The Java Performance Toolbox
A Glance At The Java Performance ToolboxAna-Maria Mihalceanu
 
Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...Farhan Tariq
 
Abdul Kader Baba- Managing Cybersecurity Risks and Compliance Requirements i...
Abdul Kader Baba- Managing Cybersecurity Risks  and Compliance Requirements i...Abdul Kader Baba- Managing Cybersecurity Risks  and Compliance Requirements i...
Abdul Kader Baba- Managing Cybersecurity Risks and Compliance Requirements i...itnewsafrica
 
UiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPathCommunity
 

Último (20)

The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
 
A Framework for Development in the AI Age
A Framework for Development in the AI AgeA Framework for Development in the AI Age
A Framework for Development in the AI Age
 
React Native vs Ionic - The Best Mobile App Framework
React Native vs Ionic - The Best Mobile App FrameworkReact Native vs Ionic - The Best Mobile App Framework
React Native vs Ionic - The Best Mobile App Framework
 
Potential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsPotential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and Insights
 
Infrared simulation and processing on Nvidia platforms
Infrared simulation and processing on Nvidia platformsInfrared simulation and processing on Nvidia platforms
Infrared simulation and processing on Nvidia platforms
 
Top 10 Hubspot Development Companies in 2024
Top 10 Hubspot Development Companies in 2024Top 10 Hubspot Development Companies in 2024
Top 10 Hubspot Development Companies in 2024
 
Accelerating Enterprise Software Engineering with Platformless
Accelerating Enterprise Software Engineering with PlatformlessAccelerating Enterprise Software Engineering with Platformless
Accelerating Enterprise Software Engineering with Platformless
 
Microsoft 365 Copilot: How to boost your productivity with AI – Part two: Dat...
Microsoft 365 Copilot: How to boost your productivity with AI – Part two: Dat...Microsoft 365 Copilot: How to boost your productivity with AI – Part two: Dat...
Microsoft 365 Copilot: How to boost your productivity with AI – Part two: Dat...
 
Email Marketing Automation for Bonterra Impact Management (fka Social Solutio...
Email Marketing Automation for Bonterra Impact Management (fka Social Solutio...Email Marketing Automation for Bonterra Impact Management (fka Social Solutio...
Email Marketing Automation for Bonterra Impact Management (fka Social Solutio...
 
Microservices, Docker deploy and Microservices source code in C#
Microservices, Docker deploy and Microservices source code in C#Microservices, Docker deploy and Microservices source code in C#
Microservices, Docker deploy and Microservices source code in C#
 
Modern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better StrongerModern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
 
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...
 
Decarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a realityDecarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a reality
 
Manual 508 Accessibility Compliance Audit
Manual 508 Accessibility Compliance AuditManual 508 Accessibility Compliance Audit
Manual 508 Accessibility Compliance Audit
 
2024 April Patch Tuesday
2024 April Patch Tuesday2024 April Patch Tuesday
2024 April Patch Tuesday
 
Varsha Sewlal- Cyber Attacks on Critical Critical Infrastructure
Varsha Sewlal- Cyber Attacks on Critical Critical InfrastructureVarsha Sewlal- Cyber Attacks on Critical Critical Infrastructure
Varsha Sewlal- Cyber Attacks on Critical Critical Infrastructure
 
A Glance At The Java Performance Toolbox
A Glance At The Java Performance ToolboxA Glance At The Java Performance Toolbox
A Glance At The Java Performance Toolbox
 
Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...
 
Abdul Kader Baba- Managing Cybersecurity Risks and Compliance Requirements i...
Abdul Kader Baba- Managing Cybersecurity Risks  and Compliance Requirements i...Abdul Kader Baba- Managing Cybersecurity Risks  and Compliance Requirements i...
Abdul Kader Baba- Managing Cybersecurity Risks and Compliance Requirements i...
 
UiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to Hero
 

JSF 2: Myth of panacea? Magic world of user interfaces

  • 1. JSF 2: myth or panacea? Magic world of user interfaces Сергей Моренец 29 августа 2012 г.
  • 2. Agenda • • • • • The history of Java Web frameworks JSF specification and roadmap JSF plugins and extensions Custom components design Q&A
  • 4.
  • 7. The history of Java Web frameworks
  • 8. The Servlet API • The introduction in March 1998 • Enabled Java developers to write server-side code for delivering dynamic Web content • Java response to CGI
  • 9. JavaServer Pages • • • • • Released in 1999 by Sun Microsystems High-level abstraction of Java servlets Java response to PHP Adds tags and expression language Works inside JSP container, which handles all JSP page view requests.
  • 10. Apache Struts • • • • • Introduced by Apache Foundation in 2000 Implementation of the Model-View-Controller paradigm Enabled actions to support navigation Templates in JSP, XML, Velocity Struts 2 with AJAX and plugins support
  • 11. Spring MVC • • • • • Released under Apache 2.0 license in 2003 Spring response to Struts framework Tightly coupled to the Spring IOC container Defines strategy interfaces for the responsibilities Supports portlet development
  • 12. The Birth of JSF • Created as JSR #127 • Designed by Sun, Oracle, IBM and BEA in May 2001 • J2EE framework for building Web applications
  • 13. The JSF Design Goals • Create a standard UI component framework • Define a set of lightweight Java classes for UI components, component state, and input events • Provide a set of common UI components • Provide a JavaBeans model for dispatching events from client-side UI controls to server-side application behavior
  • 14. The JSF Design Goals • Define APIs for input validation, including client-side validation • Specify a model for internationalization and localization • Automatic support of all available client configuration data, such as the browser version • Support Web Accessibility Initiative (WAI)
  • 15. History of JSF • Simple things should be simple. Complex things should be possible. Alan Kay
  • 16. JSF 1.0 • Initial release in March 2004 • Core and performance improvement • Supports Servlet 2.3 and JSP 1.2
  • 17. JSF 1.1 • Bugfix release in May 2004 • Performance issues • Based on J2EE 1.3
  • 18. JSF 1.2 • • • • • Release in May 2006 Fully detached from JSP as view technology Unified expression language support Lack of Ajax out-of-box support Core part of J2EE 5
  • 19. JSF 2.0 Release in June 2009 JSP replaced by facelets as view technology Full Ajax support similar to Ajax4jsf Annotations and convention-over-configuration invention • New conversation scope • • • •
  • 20. JSF Sample Page • • • • • • • • • • • • • • <html xmlns=http://www.w3.org/1999/xhtml xmlns:h=http://java.sun.com/jsf/html xmlns:f="http://java.sun.com/jsf/core"> <h:body> <h:form> <h2>A Simple JSF Page</h2> <h:outputText value="#{modelBean.currentDate}"> <f:convertDateTime type="both" timeZone="#{userLocale.timeZone}" /> </h:outputText> <h:inputText value="#{modelBean.username}"/> <h:commandButton value="Click Here"/> </h:form> </h:body> </html>
  • 21. ModelBean.java public class ModelBean { private Date currentDate; private String username; public Date getCurrentDate() { return currentDate; } public void setCurrentDate(Date currentDate) { this.currentDate = currentDate; } public String getUsername() { return username; } public void setUsername(String username) { this.username = username; } }
  • 22. Configuration file • • • • • • • • • • • • • • • <?xml version="1.0" encoding="UTF-8"?> <faces-config xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-facesconfig_2_0.xsd" version="2.0"> <application> <message-bundle>message</message-bundle> </application> <managed-bean> <managed-bean-name>modelBean</managedbean-name> <managed-beanclass>org.mycompany.ModelBean</managed-bean-class> <managed-bean-scope>session</managed-beanscope> </managed-bean> </faces-config>
  • 25. Built on JavaBeans concepts • UIComponent hierarchy Properties Methods Events Validators Convertors • Event model Listener classes Event objects • Page navigation
  • 26. JSF Implementations • Oracle reference implementation • Sub-project of Glassfish • UI widgets (MyFaces Tomahawk, MyFaces Trinidad, MyFaces Tobago) • Extension packages to (MyFaces Orchestra, MyFaces Extensions Validator, MyFaces Extensions CDI) • Integration modules ( MyFaces Portlet Bridge)
  • 27. Mojarra vs. MyFaces performance Testcase MyFaces (ms) Mojarra(ms) 1. JSF Protocol Tests 239 207 2. Full Body Replacement 42 35 4134 4426 24 34 5. Double Eval Detection 2047 2060 6. Table Test, replacement of table elements 7289 9229 6. Partial Page Rendering Nav Case 2168 2308 7. Event Lifecycle test 130 131 3. Multi form situation 4. Testing for decorated api calls
  • 28. Ajax-enabled components and frameworks • • • • • • • • • jBoss RichFaces, Ajax-enabled JSF components for layout, file upload, forms, inputs and many other features. ICEfaces, open-source, Java JSF extension framework and rich components, Ajax without JavaScript PrimeFaces Ajax framework with JSF components Oracle ADF Faces Rich Client, Oracle Application Development Framework Backbase Enterprise Ajax — JSF Edition, Ajax framework IBM Lotus Notes - XPages MyFaces, The Apache Foundation JSF implementation with Ajax components Sun Java BluePrints AJAX Components ZK Ajax framework with JSF components
  • 30. • • • • • • • • A full set of AJAX enabled components Client-side validation Advanced queuing Push component upgrades including JavaMessaging Service (JMS) integrations Component Development Kit (CDK). Comprehensive documentation covering development best practices, and component details. Detailed and automated testing facilities for components, actions, listeners, and pages. Broad cross-browser support
  • 32. Ajax4JSF • Core Ajax functionality • Page-level Ajax support • Utility components
  • 33. Rich components • Self-contained and advanced UI components • Extension of standard JSF components • Pluggable customization though Ajax support
  • 34. A Historical Perspective • Created as Telamon project in 2005 by Alexander Smirnov • Released in 2006 as part of Exadel Visual Component Platform • Split into open-source Ajax4jsf and commercial RichFaces in 2006 • Made open-source in 2007 as Jboss Ajax4jsf and Jboss RichFaces • Merged as single RichFaces product in September 2007
  • 35. Alexander Smirnov • Architect of the Jboss Richfaces project • Java Server Faces expert group member • Jboss GateIn portal developer
  • 41. Tree
  • 44. Push
  • 45. RichFaces Push • • • • Server-side push technique Based on Atmosphere framework Client-side support(Comet, HTML5 WebSockets) Integration with Java Messaging Service
  • 46. RichBean.java • public Date getDate() { • return new Date(); • } • • public void push() throws MessageException { • TopicKey topicKey = new TopicKey("sampleAddress"); • TopicsContext topicsContext = TopicsContext.lookup(); • • topicsContext.publish(topicKey, "empty message"); • }
  • 47. Index.html • <a4j:commandButton value="Push!" action="#{richBean.push}" /> • • <a4j:push address="sampleAddress"> • <a4j:ajax event="dataavailable" render="outputDate" /> • </a4j:push> • • <a4j:outputPanel id="outputDate"> • Date: #{richBean.date} • </a4j:outputPanel>
  • 49. AdvancedDateComponent.java • public class AdvancedDateComponent extends UIComponentBase { • private HtmlSelectOneMenu dayCmb; • private HtmlSelectOneMenu monthCmb; • private HtmlSelectOneMenu yearCmb; • • • • @Override public String getFamily() { return "advanced.Date"; } • • • • • @Override public String getRendererType() { return "renderer.advanced.Date"; }
  • 50. AdvancedDateComponent.java public Object getValue() { ValueExpression _ve = getValueExpression("value"); return (_ve != null) ? _ve.getValue(getFacesContext().getELContext()) : null; } public void setSubmittedValue(FacesContext context) { Map<String, String> requestParameterValuesMap = context.getExternalContext(). getRequestParameterMap(); String day = requestParameterValuesMap.get(dayCmb.getClientId(context)); String month = requestParameterValuesMap.get(monthCmb.getClientId(context)); String year = requestParameterValuesMap.get(yearCmb.getClientId(context)); Calendar calendar = Calendar.getInstance(); calendar.set(Integer.valueOf(year), Integer.valueOf(month) - 1, Integer.valueOf(day)); } ValueExpression ve = getValueExpression(“value”); ve.setValue(getFacesContext().getELContext(), calendar.getTime());
  • 51. AdvancedDateRenderer.java • public class AdvancedDateRenderer extends Renderer{ • • • • • • • • @Override public void encodeBegin(FacesContext context, UIComponent component) throws IOException { if(component instanceof AdvancedDateComponent) { CompositeDateComponent dateComponent = (CompositeDateComponent)component; dateComponent.refresh(); dateComponent.updateComponents(); }
  • 52. AdvancedDateRenderer.java • @Override • public void decode(FacesContext context, • UIComponent component) { • if (component instanceof AdvancedDateComponent) { • AdvancedDateComponent dateComponent = (AdvancedDateComponent) component; • dateComponent.refresh(); • dateComponent.setSubmittedValue(context); • }}}
  • 53. Configuration file • • • • • • • • • • • • • • • • • • • <?xml version="1.0" encoding="UTF-8"?> <faces-config xmlns="http://java.sun.com/xml/ns/javaee"> <component> <display-name>advancedDate</display-name> <component-type>advanced.Date</component-type> <component-class>org.test.component.AdvancedDateComponent </component-class> <component-extension> <renderer-type>renderer.advanced.Date</renderer-type> </component-extension> </component> <render-kit> <renderer> <component-family>advanced.Date</component-family> <renderer-type>renderer.advanced.Date</renderer-type> <renderer-class>org.test.component.AdvancedDateRenderer</rendererclass> </renderer> </render-kit> </faces-config>
  • 54. Tag configuration file • <?xml version="1.0"?> • <facelet-taglib xmlns="http://java.sun.com/JSF/Facelet"> • <namespace>http://test.org/web/tags</namespace> <tag> <tag-name>advancedDate</tag-name> <component> <componenttype>advanced.Date</component-type> • <renderertype>renderer.advanced.Date</renderer-type> • </component> • </tag> • • • • • </facelet-taglib>
  • 57. Custom components • • • • No configuration, XML or otherwise. No Java code. To which developers can attach functionality. Hot-deploy.
  • 58. compositeDate.xhtml <html xmlns="http://www.w3.org/1999/xhtml" xmlns:f="http://java.sun.com/jsf/core" xmlns:h="http://java.sun.com/jsf/html" xmlns:cc="http://java.sun.com/jsf/composite"> <cc:interface> <cc:attribute name="birthDate" shortDescription="Value of the component" /> <cc:attribute name="days" shortDescription="List of SelectItem objects representing days" /> <cc:attribute name="months" shortDescription="List of SelectItem objects representing months" /> <cc:attribute name="years" shortDescription="List of SelectItem objects representing years" /> </cc:interface>
  • 59. compositeDate.xhtml <cc:implementation> <h:panelGrid columns="3"> <h:selectOneMenu value="#{date.day}"> <f:selectItems value="#{days}" /> </h:selectOneMenu> <h:selectOneMenu value="#{date.month}"> <f:selectItems value="#{months}" /> </h:selectOneMenu> <h:selectOneMenu value="#{date.year}"> <f:selectItems value="#{years}" /> </h:selectOneMenu> </h:panelGrid> </cc:implementation> </html>
  • 64. • • • • • • High level of understanding Limited community support Lack of books and comprehensive documentation Multiple resource-consuming dependencies Performance overhead Migration issues between RF3 and RF4
  • 65. Love bug story • I am migrating from RF 3.3.1 to 4.0. I'm experiencing an issue with the tooltip component. Specifying "bottom-left" for the direction attribute results in the following error: • javax.el.ELException: Cannot convert bottom-left of type class java.lang.String to class org.richfaces.component.Positioning • Was this attribute implemented in 4.0? Am I doing something wrong?
  • 66. Love bug story • Just in case someone else has the same issue, I've figured it out. In RF 4, 'bottom-right' positioning is no longer valid. You have to use 'bottomRight'. I am completely shocked that none of these changes have made it to their online documentation. I have wasted time trying to figure out what was happening with this component. I cannot believe users are expected to go to the API JavaDocs and look through each class for possible attribute values. • • If any RichFaces guys read this, please either update the online documentation or remove it. There are way too many components in there with information that has not been updated and is just plain wrong