SlideShare uma empresa Scribd logo
1 de 47
Baixar para ler offline
Jay Balunas | JBoss, By Red Hat


RichFaces 4.0 Component
       Deep Dive
Who am I

•   RichFaces Project Lead
•   JBoss Core Developer
•   JSF 2.2 Expert Group
•   Red Hat W3C Member
Presentation Links Page



http://bit.ly/rfdeepdive
The Plan...
•   Base Info
•   RichFaces Client Queue
•   Client Side Validation
•   RichFaces Push
•   JSF & Project Updates
JavaServer Faces (JSF)
   JSF 1.2
                       Made RichFaces, Seam,
     EE5              Facelets, etc...
     Extensible       Possible!

   JSF 2.0
     EE6
     Standardized Adv. Features

     Still Extensible
What Features..
Annotation based       Integrated Ajax
configuration
                       Bean validation
Facelets
                       Event system
Composite components
                       Exception handling
JSP deprecated
                       Implicit navigation
Bookmark GET support
                       Behaviors framework
Built in resource
handling               Project stages
RichFaces 4.0 Lighting Review
• Advanced framework built on top of JSF
  o Extends JSF core
  o Full set of UI components
  o Resource Handling
  o Component development kit
  o Skinning

• Two tag libraries
   o a4j: Page level ajax support & utility
     components
   o rich: Self contained visual components
The Plan...
•   Base Info
•   RichFaces Client Queue
•   Client Side Validation
•   RichFaces Push
•   JSF & Project Updates
JSF 2.0 Request Queue

•   New with JSF 2.0
•   Preserves server/client state
•   Very few options
•   No client side api
•   Can lead to traffic jams...
<a4j:queue ... >
• Logical queue on top of JSF 2
• Tuning features
    • requestDelay
    • ignoreDupResponses
    • requestGrouping
• Queue scoping
• Client side events & API
Request Delay
<h:form id="form">
  <!-- Queue applied to whole form -->
  <a4j:queue requestDelay="500"/>

  <h:inputText id="username" value="#{userBean.name}" />
      <a4j:ajax event="keyup" .../>
  </h:inputText>
  <h:inputText id="message" value="#{userBean.msg}" />
      <a4j:ajax event="keyup" .../>
  </h:inputText>
  ...
</h:form>
Queue Effects



http://bit.ly/kKxKGF
Global Queue

<context-param>
  <param-name>org.richfaces.queue.enabled</param-name>
  <param-value>true</param-value>
</context-param>


     View Scoped                         Form Scoped

<f:view>                          <h:form id="form">
<!-- Applied to whole view -->      <!-- Applied to whole form -->
<a4j:queue                          <a4j:queue
       requestDelay="500"/>               requestDelay="1000"/>
   ...                              ...
Named Queues
<!-- Checking availability is costly, so send less often -->
<a4j:queue name="available_queue" requestDelay="2000"/>
...
<h:inputText id="username"
              value="#{registrationBean.username}" />
    <a4j:ajax event="keyup" action="checkUsername" >
      <a4j:attachQueue name="available_queue"/>
    </a4j:ajax>
</h:inputText>
AttachQueue Tips
• Override settings directly
• Skip the named queue


         http://bit.ly/ilJu6e
Client-Side Events & API
• Events
    • complete()
    • requestqueue()
    • requestdequeued()
• API
    • queue.getSize()
    • queue.isEmpty()
    • queue.set/getQueueOptions()
The Plan...
•   Base Info
•   RichFaces Client Queue
•   Client Side Validation
•   RichFaces Push
•   JSF & Project Updates
What is Bean Validation
• Bean Validation JSR-303
  o   Part of Java EE6
• Generic, tier independent constraints
• Custom, and composition constraints
  possible
• Constraint groups, and object graph
  validation
• Message localization
• Define constraints once, apply everywhere*
Bean Validation Sample
public class User {

    @NotEmpty @Size(max=100)
    private String name;

    @NotEmpty
    @Pattern(regexp = "[a-zA-Z0-9]+@[a-zA-Z0-9].....")
    private String email;

    @ValidProject
    private String project;
}
RichFaces 4.0 & BV

• Introduces client-side validation
 o JSFvalidators
 o Bean validation constraints
• JavaScript implementations
 o Validators
 o Converters
• rich:message(s) enhanced
BV Constraints & JSF Validators
JSF Validation Example:
- Demo: http://bit.ly/mJ9qK4
- XHTML: http://bit.ly/k7YhG6
- Java: http://bit.ly/lLw4PZ

Bean Validation Example:
- Demo: http://bit.ly/hsCJ16
- XHMTL:  http://bit.ly/l7MkLA
- Java: http://bit.ly/iQJvGP
Additional Features

• Behavior events
• Ajax fallback
• Custom constraints*
 Login:
 <h:inputText id="login" value="#{user.login}">
   <rich:validator event="keyup"/>
 </h:inputText>
 <rich:message for="login"/>
GraphValidation

• Validate all fields of a model object
 o Notjust current view values
 o Adds method validations


• In the validation phase
 o Not   hijacking the lifecycle
<h:inputSecret id="pwd1" value="#{regBean.pwd1}"/>
...
<h:inputsecret id="pwd2" value="#{regBean.pwd2}"/>

@Size(min = 5,   max = 15, message = "Wrong size for password")
private String   pwd1="";
@Size(min = 5,   max = 15, message = "Wrong size for confirmation")
private String   pwd2="";
Graph Validation Example:
- Demo: http://bit.ly/lv6ccS
- XHTML: http://bit.ly/jZltn8
- Java: http://bit.ly/l6W1U2
The Plan...
•   Base Info
•   RichFaces Client Queue
•   Client Side Validation
•   RichFaces Push
•   JSF & Project Updates
What Is Server-Side Push


Server-events can push updates/data
         to the the browser
<a4j:push ...>

• Integrates with Atmosphere
 o Comet/WebSockets
 o Graceful   degradation

• Java Messaging Service (JMS)
 o Reliability,   flexibility, etc....
<a4j:push ...> Basic Usage
Customizable subtopic               Topic configured in JMS


<a4j:push address="subtopic@twPush"
          onerror="alert(event.rf.data)"
          ondataavailable="processData(event.rf.data)"/>

                        Supports EL as well


          address="#{twBean.curSearch}@twPush"
Getting the Message Out
• TopicsContext
  – In application
  – Handles JMS details

• Direct JMS
  – Standard JMS messages
  – From anywhere
Getting the Message Out

 TopicsContext Publishing
 - TweetStream: http://bit.ly/itrrbS



 Standard JMS Message
 - TweetStream: http://bit.ly/kQcriB
Client Processing Options
• Partial Page Rendering
  – No data payload needed
  – Use JSF to process rendering


• Direct DOM Updates
  – Data payload
    • String, or JSON
  – JavaScript Required
Client Processing Options

Partial Page Rendering Example
- Demo: http://bit.ly/tweetstream2
- XHTML: http://bit.ly/ijIUNS
 
Direct DOM Updates Example
- IRC-Chat XHTML: http://bit.ly/m2AYnY
- IRC-Chat Java: http://bit.ly/lSe055
<a4j:push ...> Setup

• JMS server setup
  o JNDI   name: /topic/<topic>
• web.xml setup
  o JMS    factory & topic namespaces
• Topics Initializer
  o Binds   topic to richfaces
<a4j:push ...> Setup

Automatic JMS configuration with hornetq & JBoss AS
    - JMS: http://bit.ly/lNjGgg
    - Role: http://bit.ly/mgskTi

web.xml: http://bit.ly/jreH3k

TopicsInitializer: http://bit.ly/jDOwzm
The Plan...
•   Base Info
•   RichFaces Client Queue
•   Client Side Validation
•   RichFaces Push
•   JSF & Project Updates
JavaServer Faces Futures
• JSF 2.0/2.1
    • Released & implemented
• JSF 2.2
    • In JCP now - due end of year
    • Priorities: portals, ease of use, minor
    features, bugs
• JSF 3.0
    • Part of EE 7
    •No JSR yet
RichFaces 3.3.X
• JSF 1.2
   o EE5

• Community
  o 3.3.4 SNAPSHOT
  o No release plans at this time

• Enterprise fully supported via
  o Enterprise Application Platform 4/5 (EAP)
  o Enterprise Portal Platform 4/5 (EPP)
  o Web Framework Kit 1.X (WFK)
RichFaces 4.X
• 4.0.0.Final Released in March!!
  o JSF 2.0/2.1

• Community
  o 4.1.0 in development now

• Enterprise supported via
  o Enterprise Application Platform 6 (EAP)
  o Enterprise Portal Platform 6 (EPP)
  o Web Framework Kit 2 (WFK)
RichFaces 4.1
• Time-boxed 6 month release plan
  o Fall 2011
                                  Plus of coarse:
                                  bug fixes &
• In the works:                   stabilization
   o Git migration
   o Mobile & HTML5 updates
   o New components
   o Seam-forge integration    rich:editor
                              rich:notify
   o Sandbox & CDK process    rich:picklist
                              rich:orderedlist
   o and more...              etc....
Rich Components!
http://richfaces.org/showcase
Getting Started
• Project Page: http://richfaces.org
• 4.0.0.Final Downloads
  o   http://bit.ly/RF_Downloads
• Getting Started Guide
  o   http://bit.ly/RH_Getting_Started
• User Forums & Wiki
  o   http://bit.ly/RF_User_Space
• RichFaces Bug Tracker
  o   http://bit.ly/RF_Jira
Getting Involved
• Developer Forums & Wiki
  o   http://bit.ly/RF_Dev_Space
• Development Guide
  o   http://bit.ly/RF_Dev_Setup
• GitHub Source
  o   https://github.com/organizations/richfaces
• Build Options
  o   http://bit.ly/RF_Build_Options
• CI Server
  o   http://bit.ly/RF_Hudson_CI
More Way To Connect
• Project Twitter Account
  o http://twitter.com/richfaces


• Project Calendar
  o http://bit.ly/RF_Calendar

• IRC
   o #richfaces @ irc.freenode.net

• Team Meetings (open to all)
   o http://bit.ly/RF_Team_Mtgs
Wrap up and Q&A
My Contact Info:
•   http://in.relation.to/Bloggers/Jay
•   http://twitter.com/tech4j
•   http://github.com/balunasj
•   jbalunas@jboss.org
RichFaces 4 Component Deep Dive - JAX/JSFSummit

Mais conteúdo relacionado

Mais procurados

Single page apps_with_cf_and_angular[1]
Single page apps_with_cf_and_angular[1]Single page apps_with_cf_and_angular[1]
Single page apps_with_cf_and_angular[1]
ColdFusionConference
 
HTML5 Offline Web Application
HTML5 Offline Web ApplicationHTML5 Offline Web Application
HTML5 Offline Web Application
Allan Huang
 
Intro to polymer-Devfest Yaoundé 2013
Intro to polymer-Devfest Yaoundé 2013Intro to polymer-Devfest Yaoundé 2013
Intro to polymer-Devfest Yaoundé 2013
gdgyaounde
 

Mais procurados (20)

RESTful API - Best Practices
RESTful API - Best PracticesRESTful API - Best Practices
RESTful API - Best Practices
 
Web api
Web apiWeb api
Web api
 
How we rest
How we restHow we rest
How we rest
 
Breaking SAP portal (HackerHalted)
Breaking SAP portal (HackerHalted)Breaking SAP portal (HackerHalted)
Breaking SAP portal (HackerHalted)
 
JavaScript and jQuery for SharePoint Developers
JavaScript and jQuery for SharePoint DevelopersJavaScript and jQuery for SharePoint Developers
JavaScript and jQuery for SharePoint Developers
 
REST and ASP.NET Web API (Tunisia)
REST and ASP.NET Web API (Tunisia)REST and ASP.NET Web API (Tunisia)
REST and ASP.NET Web API (Tunisia)
 
Single page apps_with_cf_and_angular[1]
Single page apps_with_cf_and_angular[1]Single page apps_with_cf_and_angular[1]
Single page apps_with_cf_and_angular[1]
 
SharePoint 2013 Javascript Object Model
SharePoint 2013 Javascript Object ModelSharePoint 2013 Javascript Object Model
SharePoint 2013 Javascript Object Model
 
HTML5 Offline Web Application
HTML5 Offline Web ApplicationHTML5 Offline Web Application
HTML5 Offline Web Application
 
RESTful http_patterns_antipatterns
RESTful http_patterns_antipatternsRESTful http_patterns_antipatterns
RESTful http_patterns_antipatterns
 
Web API Basics
Web API BasicsWeb API Basics
Web API Basics
 
Rapi::Blog talk - TPC 2017
Rapi::Blog talk - TPC 2017Rapi::Blog talk - TPC 2017
Rapi::Blog talk - TPC 2017
 
Intro to polymer-Devfest Yaoundé 2013
Intro to polymer-Devfest Yaoundé 2013Intro to polymer-Devfest Yaoundé 2013
Intro to polymer-Devfest Yaoundé 2013
 
JSF 2.0 Preview
JSF 2.0 PreviewJSF 2.0 Preview
JSF 2.0 Preview
 
Webinar: IBM Connections Adminblast
Webinar: IBM Connections AdminblastWebinar: IBM Connections Adminblast
Webinar: IBM Connections Adminblast
 
Web flowpresentation
Web flowpresentationWeb flowpresentation
Web flowpresentation
 
Show Some Spine!
Show Some Spine!Show Some Spine!
Show Some Spine!
 
OAuth-as-a-service using ASP.NET Web API and Windows Azure Access Control - W...
OAuth-as-a-service using ASP.NET Web API and Windows Azure Access Control - W...OAuth-as-a-service using ASP.NET Web API and Windows Azure Access Control - W...
OAuth-as-a-service using ASP.NET Web API and Windows Azure Access Control - W...
 
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
 
HTML5 features & JavaScript APIs
HTML5 features & JavaScript APIsHTML5 features & JavaScript APIs
HTML5 features & JavaScript APIs
 

Destaque

Rich faces in_the_cloud_mini_booth
Rich faces in_the_cloud_mini_boothRich faces in_the_cloud_mini_booth
Rich faces in_the_cloud_mini_booth
balunasj
 

Destaque (6)

A Peek At The Future: Going Beyond JavaServer Faces 2.0 With RichFaces 4
A Peek At The Future: Going Beyond JavaServer Faces 2.0 With RichFaces 4A Peek At The Future: Going Beyond JavaServer Faces 2.0 With RichFaces 4
A Peek At The Future: Going Beyond JavaServer Faces 2.0 With RichFaces 4
 
Rich faces in_the_cloud_mini_booth
Rich faces in_the_cloud_mini_boothRich faces in_the_cloud_mini_booth
Rich faces in_the_cloud_mini_booth
 
The Mobile Web Revealed For The Java Developer
The Mobile Web Revealed For The Java DeveloperThe Mobile Web Revealed For The Java Developer
The Mobile Web Revealed For The Java Developer
 
Realtime web application with java
Realtime web application with javaRealtime web application with java
Realtime web application with java
 
Hype vs. Reality: The AI Explainer
Hype vs. Reality: The AI ExplainerHype vs. Reality: The AI Explainer
Hype vs. Reality: The AI Explainer
 
Study: The Future of VR, AR and Self-Driving Cars
Study: The Future of VR, AR and Self-Driving CarsStudy: The Future of VR, AR and Self-Driving Cars
Study: The Future of VR, AR and Self-Driving Cars
 

Semelhante a RichFaces 4 Component Deep Dive - JAX/JSFSummit

Going Above JSF 2.0 with RichFaces and Seam
Going Above JSF 2.0 with RichFaces and SeamGoing Above JSF 2.0 with RichFaces and Seam
Going Above JSF 2.0 with RichFaces and Seam
Lincoln III
 
RichFaces: rich:* component library
RichFaces: rich:* component libraryRichFaces: rich:* component library
RichFaces: rich:* component library
Max Katz
 
Web Technologies in Java EE 7
Web Technologies in Java EE 7Web Technologies in Java EE 7
Web Technologies in Java EE 7
Lukáš Fryč
 
HTML5 Server Sent Events/JSF JAX 2011 Conference
HTML5 Server Sent Events/JSF  JAX 2011 ConferenceHTML5 Server Sent Events/JSF  JAX 2011 Conference
HTML5 Server Sent Events/JSF JAX 2011 Conference
Roger Kitain
 

Semelhante a RichFaces 4 Component Deep Dive - JAX/JSFSummit (20)

Going Above JSF 2.0 with RichFaces and Seam
Going Above JSF 2.0 with RichFaces and SeamGoing Above JSF 2.0 with RichFaces and Seam
Going Above JSF 2.0 with RichFaces and Seam
 
RichFaces 4: Rich Ajax Components For Your JSF Applications
RichFaces 4: Rich Ajax Components For Your JSF ApplicationsRichFaces 4: Rich Ajax Components For Your JSF Applications
RichFaces 4: Rich Ajax Components For Your JSF Applications
 
RichFaces: rich:* component library
RichFaces: rich:* component libraryRichFaces: rich:* component library
RichFaces: rich:* component library
 
JSF2
JSF2JSF2
JSF2
 
Go Fullstack: JSF for Public Sites (CONFESS 2013)
Go Fullstack: JSF for Public Sites (CONFESS 2013)Go Fullstack: JSF for Public Sites (CONFESS 2013)
Go Fullstack: JSF for Public Sites (CONFESS 2013)
 
How to Contribute to Apache Usergrid
How to Contribute to Apache UsergridHow to Contribute to Apache Usergrid
How to Contribute to Apache Usergrid
 
Node.js to the rescue
Node.js to the rescueNode.js to the rescue
Node.js to the rescue
 
IVS CTO Night And Day 2018 Winter - [re:Cap] Serverless & Mobile
IVS CTO Night And Day 2018 Winter - [re:Cap] Serverless & MobileIVS CTO Night And Day 2018 Winter - [re:Cap] Serverless & Mobile
IVS CTO Night And Day 2018 Winter - [re:Cap] Serverless & Mobile
 
RichFaces 4 webinar #2: RichFaces 3 toRichFaces 4
RichFaces 4 webinar #2: RichFaces 3 toRichFaces 4RichFaces 4 webinar #2: RichFaces 3 toRichFaces 4
RichFaces 4 webinar #2: RichFaces 3 toRichFaces 4
 
Web Technologies in Java EE 7
Web Technologies in Java EE 7Web Technologies in Java EE 7
Web Technologies in Java EE 7
 
HTML5 Server Sent Events/JSF JAX 2011 Conference
HTML5 Server Sent Events/JSF  JAX 2011 ConferenceHTML5 Server Sent Events/JSF  JAX 2011 Conference
HTML5 Server Sent Events/JSF JAX 2011 Conference
 
Spark IT 2011 - Simplified Web Development using Java Server Faces 2.0
Spark IT 2011 - Simplified Web Development using Java Server Faces 2.0Spark IT 2011 - Simplified Web Development using Java Server Faces 2.0
Spark IT 2011 - Simplified Web Development using Java Server Faces 2.0
 
RichFaces 4 Webinar - New and Advanced Features
RichFaces 4 Webinar - New and Advanced FeaturesRichFaces 4 Webinar - New and Advanced Features
RichFaces 4 Webinar - New and Advanced Features
 
JSF 2: Myth of panacea? Magic world of user interfaces
JSF 2: Myth of panacea? Magic world of user interfacesJSF 2: Myth of panacea? Magic world of user interfaces
JSF 2: Myth of panacea? Magic world of user interfaces
 
Groovy & Grails eXchange 2012 vert.x presentation
Groovy & Grails eXchange 2012 vert.x presentationGroovy & Grails eXchange 2012 vert.x presentation
Groovy & Grails eXchange 2012 vert.x presentation
 
Rapid development with Rails
Rapid development with RailsRapid development with Rails
Rapid development with Rails
 
What You Need To Build Cool Enterprise Applications With JSF
What You Need To Build Cool Enterprise Applications With JSFWhat You Need To Build Cool Enterprise Applications With JSF
What You Need To Build Cool Enterprise Applications With JSF
 
Lecture 10 - Java Server Faces (JSF)
Lecture 10 - Java Server Faces (JSF)Lecture 10 - Java Server Faces (JSF)
Lecture 10 - Java Server Faces (JSF)
 
Go Fullstack: JSF for Public Sites (CONFESS 2012)
Go Fullstack: JSF for Public Sites (CONFESS 2012)Go Fullstack: JSF for Public Sites (CONFESS 2012)
Go Fullstack: JSF for Public Sites (CONFESS 2012)
 
Code First with Serverless Azure Functions
Code First with Serverless Azure FunctionsCode First with Serverless Azure Functions
Code First with Serverless Azure Functions
 

Último

Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Victor Rentea
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 

Último (20)

Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with Milvus
 
Spring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUKSpring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUK
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistan
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 

RichFaces 4 Component Deep Dive - JAX/JSFSummit

  • 1. Jay Balunas | JBoss, By Red Hat RichFaces 4.0 Component Deep Dive
  • 2. Who am I • RichFaces Project Lead • JBoss Core Developer • JSF 2.2 Expert Group • Red Hat W3C Member
  • 4. The Plan... • Base Info • RichFaces Client Queue • Client Side Validation • RichFaces Push • JSF & Project Updates
  • 5. JavaServer Faces (JSF)  JSF 1.2 Made RichFaces, Seam,  EE5 Facelets, etc...  Extensible Possible!  JSF 2.0  EE6  Standardized Adv. Features  Still Extensible
  • 6. What Features.. Annotation based Integrated Ajax configuration Bean validation Facelets Event system Composite components Exception handling JSP deprecated Implicit navigation Bookmark GET support Behaviors framework Built in resource handling Project stages
  • 7. RichFaces 4.0 Lighting Review • Advanced framework built on top of JSF o Extends JSF core o Full set of UI components o Resource Handling o Component development kit o Skinning • Two tag libraries o a4j: Page level ajax support & utility components o rich: Self contained visual components
  • 8. The Plan... • Base Info • RichFaces Client Queue • Client Side Validation • RichFaces Push • JSF & Project Updates
  • 9. JSF 2.0 Request Queue • New with JSF 2.0 • Preserves server/client state • Very few options • No client side api • Can lead to traffic jams...
  • 10. <a4j:queue ... > • Logical queue on top of JSF 2 • Tuning features • requestDelay • ignoreDupResponses • requestGrouping • Queue scoping • Client side events & API
  • 11. Request Delay <h:form id="form"> <!-- Queue applied to whole form --> <a4j:queue requestDelay="500"/> <h:inputText id="username" value="#{userBean.name}" /> <a4j:ajax event="keyup" .../> </h:inputText> <h:inputText id="message" value="#{userBean.msg}" /> <a4j:ajax event="keyup" .../> </h:inputText> ... </h:form>
  • 13. Global Queue <context-param> <param-name>org.richfaces.queue.enabled</param-name> <param-value>true</param-value> </context-param> View Scoped Form Scoped <f:view> <h:form id="form"> <!-- Applied to whole view --> <!-- Applied to whole form --> <a4j:queue <a4j:queue requestDelay="500"/> requestDelay="1000"/> ... ...
  • 14. Named Queues <!-- Checking availability is costly, so send less often --> <a4j:queue name="available_queue" requestDelay="2000"/> ... <h:inputText id="username" value="#{registrationBean.username}" /> <a4j:ajax event="keyup" action="checkUsername" > <a4j:attachQueue name="available_queue"/> </a4j:ajax> </h:inputText>
  • 15. AttachQueue Tips • Override settings directly • Skip the named queue http://bit.ly/ilJu6e
  • 16. Client-Side Events & API • Events • complete() • requestqueue() • requestdequeued() • API • queue.getSize() • queue.isEmpty() • queue.set/getQueueOptions()
  • 17. The Plan... • Base Info • RichFaces Client Queue • Client Side Validation • RichFaces Push • JSF & Project Updates
  • 18. What is Bean Validation • Bean Validation JSR-303 o Part of Java EE6 • Generic, tier independent constraints • Custom, and composition constraints possible • Constraint groups, and object graph validation • Message localization • Define constraints once, apply everywhere*
  • 19. Bean Validation Sample public class User { @NotEmpty @Size(max=100) private String name; @NotEmpty @Pattern(regexp = "[a-zA-Z0-9]+@[a-zA-Z0-9].....") private String email; @ValidProject private String project; }
  • 20. RichFaces 4.0 & BV • Introduces client-side validation o JSFvalidators o Bean validation constraints • JavaScript implementations o Validators o Converters • rich:message(s) enhanced
  • 21. BV Constraints & JSF Validators JSF Validation Example: - Demo: http://bit.ly/mJ9qK4 - XHTML: http://bit.ly/k7YhG6 - Java: http://bit.ly/lLw4PZ Bean Validation Example: - Demo: http://bit.ly/hsCJ16 - XHMTL:  http://bit.ly/l7MkLA - Java: http://bit.ly/iQJvGP
  • 22. Additional Features • Behavior events • Ajax fallback • Custom constraints* Login: <h:inputText id="login" value="#{user.login}"> <rich:validator event="keyup"/> </h:inputText> <rich:message for="login"/>
  • 23. GraphValidation • Validate all fields of a model object o Notjust current view values o Adds method validations • In the validation phase o Not hijacking the lifecycle
  • 24. <h:inputSecret id="pwd1" value="#{regBean.pwd1}"/> ... <h:inputsecret id="pwd2" value="#{regBean.pwd2}"/> @Size(min = 5, max = 15, message = "Wrong size for password") private String pwd1=""; @Size(min = 5, max = 15, message = "Wrong size for confirmation") private String pwd2="";
  • 25. Graph Validation Example: - Demo: http://bit.ly/lv6ccS - XHTML: http://bit.ly/jZltn8 - Java: http://bit.ly/l6W1U2
  • 26. The Plan... • Base Info • RichFaces Client Queue • Client Side Validation • RichFaces Push • JSF & Project Updates
  • 27. What Is Server-Side Push Server-events can push updates/data to the the browser
  • 28. <a4j:push ...> • Integrates with Atmosphere o Comet/WebSockets o Graceful degradation • Java Messaging Service (JMS) o Reliability, flexibility, etc....
  • 29. <a4j:push ...> Basic Usage Customizable subtopic Topic configured in JMS <a4j:push address="subtopic@twPush" onerror="alert(event.rf.data)" ondataavailable="processData(event.rf.data)"/> Supports EL as well address="#{twBean.curSearch}@twPush"
  • 30. Getting the Message Out • TopicsContext – In application – Handles JMS details • Direct JMS – Standard JMS messages – From anywhere
  • 31. Getting the Message Out TopicsContext Publishing - TweetStream: http://bit.ly/itrrbS Standard JMS Message - TweetStream: http://bit.ly/kQcriB
  • 32. Client Processing Options • Partial Page Rendering – No data payload needed – Use JSF to process rendering • Direct DOM Updates – Data payload • String, or JSON – JavaScript Required
  • 33. Client Processing Options Partial Page Rendering Example - Demo: http://bit.ly/tweetstream2 - XHTML: http://bit.ly/ijIUNS   Direct DOM Updates Example - IRC-Chat XHTML: http://bit.ly/m2AYnY - IRC-Chat Java: http://bit.ly/lSe055
  • 34. <a4j:push ...> Setup • JMS server setup o JNDI name: /topic/<topic> • web.xml setup o JMS factory & topic namespaces • Topics Initializer o Binds topic to richfaces
  • 35. <a4j:push ...> Setup Automatic JMS configuration with hornetq & JBoss AS     - JMS: http://bit.ly/lNjGgg     - Role: http://bit.ly/mgskTi web.xml: http://bit.ly/jreH3k TopicsInitializer: http://bit.ly/jDOwzm
  • 36. The Plan... • Base Info • RichFaces Client Queue • Client Side Validation • RichFaces Push • JSF & Project Updates
  • 37. JavaServer Faces Futures • JSF 2.0/2.1 • Released & implemented • JSF 2.2 • In JCP now - due end of year • Priorities: portals, ease of use, minor features, bugs • JSF 3.0 • Part of EE 7 •No JSR yet
  • 38. RichFaces 3.3.X • JSF 1.2 o EE5 • Community o 3.3.4 SNAPSHOT o No release plans at this time • Enterprise fully supported via o Enterprise Application Platform 4/5 (EAP) o Enterprise Portal Platform 4/5 (EPP) o Web Framework Kit 1.X (WFK)
  • 39. RichFaces 4.X • 4.0.0.Final Released in March!! o JSF 2.0/2.1 • Community o 4.1.0 in development now • Enterprise supported via o Enterprise Application Platform 6 (EAP) o Enterprise Portal Platform 6 (EPP) o Web Framework Kit 2 (WFK)
  • 40. RichFaces 4.1 • Time-boxed 6 month release plan o Fall 2011 Plus of coarse: bug fixes & • In the works: stabilization o Git migration o Mobile & HTML5 updates o New components o Seam-forge integration rich:editor rich:notify o Sandbox & CDK process rich:picklist rich:orderedlist o and more... etc....
  • 43. Getting Started • Project Page: http://richfaces.org • 4.0.0.Final Downloads o http://bit.ly/RF_Downloads • Getting Started Guide o http://bit.ly/RH_Getting_Started • User Forums & Wiki o http://bit.ly/RF_User_Space • RichFaces Bug Tracker o http://bit.ly/RF_Jira
  • 44. Getting Involved • Developer Forums & Wiki o http://bit.ly/RF_Dev_Space • Development Guide o http://bit.ly/RF_Dev_Setup • GitHub Source o https://github.com/organizations/richfaces • Build Options o http://bit.ly/RF_Build_Options • CI Server o http://bit.ly/RF_Hudson_CI
  • 45. More Way To Connect • Project Twitter Account o http://twitter.com/richfaces • Project Calendar o http://bit.ly/RF_Calendar • IRC o #richfaces @ irc.freenode.net • Team Meetings (open to all) o http://bit.ly/RF_Team_Mtgs
  • 46. Wrap up and Q&A My Contact Info: • http://in.relation.to/Bloggers/Jay • http://twitter.com/tech4j • http://github.com/balunasj • jbalunas@jboss.org