SlideShare una empresa de Scribd logo
1 de 44
Descargar para leer sin conexión
www.icefaces.org
ICEfaces is…
ICEfaces is an Ajax framework that allows developers to easily
create rich Internet applications (RIA) in pure Java.
•   Open source
•   Standards-based
•   Extends JavaServer Faces
•   Develop rich Web Applications in pure Java,
    not JavaScript
•   Integrated with GlassFish and Friends
     – Provides NetBeans IDE Plugin
          • Endorsed migration for Woodstock users
     – Supports Ajax Push applications via Grizzly
     – Leverages enterprise capabilities of GlassFish
          • Security, Scalability: Clustering, Load Balancing and Failover
     – Integrates with 3rd Party frameworks and middleware
          • WebSpace, WebStack

                           Easy Ajax for Java developers

                                                                   www.icefaces.org
Agenda

 • Ajax Push Overview
 • Application Programming Basics
 • On the Wire
 • Code Walkthrough
 • Asynchronous Request Processing
 • Security
 • Custom Components (JSF 1.2 and JSF 2.0)
 • JSF 2.0 Ajax
 • JSF 2.0 Notable Enhancements
 • Summary


                                     www.icefaces.org
Multi-user AuctionMonitor




                            www.icefaces.org
Multi-user AuctionMonitor




                            www.icefaces.org
Multi-user AuctionMonitor




                            www.icefaces.org
Multi-user Locking




                            Ted selects
                            record for
                            editing




                     www.icefaces.org
Multi-user Locking




                            Joe selects
                            same record,
                            requests lock




                     www.icefaces.org
Multi-user Locking




                            Ted responds,
                            and accepts
                            or denies




                     www.icefaces.org
Push in Portlets




                                 Portal page
                                 with three
                                 portlets




                   www.icefaces.org
Push in Portlets




                                Joe searches
                                for a city




                   www.icefaces.org
Push in Portlets




                                 All three
                                 portlets are
                                 updated




                   www.icefaces.org
Ajax Push Illustrated




           Ted




                        Server




           Deryk


                             www.icefaces.org
Ajax Push Illustrated




                         Ajax
                        Request
           Ted




                              Server




           Deryk


                                   www.icefaces.org
Ajax Push Illustrated




                        JSF Lifecycle +
                           DOM diff
           Ted




                                 Server




           Deryk


                                      www.icefaces.org
Ajax Push Illustrated




                          Ajax
                        Response
           Ted




                              Server

                          Ajax
                          Push


           Deryk


                                   www.icefaces.org
What is Ajax Push For?

•   Distance learning
•   Collaborative authoring
•   Auctions
•   Shared WebDAV filesystem
•   Blogging and reader comments
•   SIP-coordinated mobile applications
•   Hybrid chat/email/discussion forums
•   Customer assistance on sales/support pages
•   Multi-step business process made collaborative
•   Shared trip planner or restaurant selector with maps
•   Shared calendar, “to do” list, project plan
•   Games
•   Enterprise shared record locking and negotiation

                                             www.icefaces.org
Ajax Programming, Ideally.


          PageBean.java                            Page.xhtml
                                   <f:view
public class PageBean {
                                      xmlns:f=“http://java.sun.com/jsf/core”
   String message;
                                      xmlns:h=quot;http://java.sun.com/jsf/html“ >
    public String getMessage() {
                                     <html>
       return message;
                                       <body>
    }
                                         <h:form>
                                            <h:inputText
    public void
                                               value=“#{pageBean.message}” />
    setMessage(String message) {
                                         </h:form>
       this.message = message;         </body>
    }                                </html>

}                                  </f:view>



    Presentation Model                   Declarative User Interface


                                                  www.icefaces.org
Ajax Push Programming




 To keep track of groups of users:
 SessionRenderer.addCurrentSession(“GlassFishTV”);



 Asynchronously and elsewhere in the application ...
 presentation.setSlide(7);
 SessionRenderer.render(“GlassFishTV”);




                                       www.icefaces.org
Ajax Push Techniques

 • Poll
    – send a request to the server
      at some interval
    – response is “empty” if there is
      no update

 • Http Streaming
    – send a request and wait for
      response
    – write “endless” response in
      chunks

 • Long Poll
    – send a request to the server
      and wait for response
    – indistinguishable from “slow”
      server




                                        www.icefaces.org
Long Polling over HTTP
 GET /auctionMonitor/block/receive-updates?icefacesID=1209765435 HTTP/1.1
 Accept: */*
 Cookie: JSESSIONID=75CF2BF3E03F0F9C6D2E8EFE1A6884F4
 Connection: keep-alive
 Host: vorlon.ice:18080




                                                 www.icefaces.org
Long Polling over HTTP
 GET /auctionMonitor/block/receive-updates?icefacesID=1209765435 HTTP/1.1
 Accept: */*
 Cookie: JSESSIONID=75CF2BF3E03F0F9C6D2E8EFE1A6884F4
 Connection: keep-alive
 Host: vorlon.ice:18080


                                     Chat message “Howdy”




                                                 www.icefaces.org
Long Polling over HTTP
 GET /auctionMonitor/block/receive-updates?icefacesID=1209765435 HTTP/1.1
 Accept: */*
 Cookie: JSESSIONID=75CF2BF3E03F0F9C6D2E8EFE1A6884F4
 Connection: keep-alive
 Host: vorlon.ice:18080


                                      Chat message “Howdy”

 HTTP/1.1 200 OK
 Content-Type: text/xml;charset=UTF-8
 Content-Length: 180
 Date: Tue, 10 Mar 2009 22:49:49 GMT
 Server: Sun Java System Application Server 9.1_01

 <updates>
   <update address=quot;_id0:_id5:0:chatTextquot;>
     <span id=quot;_id0:_id5:0:chatTextquot;>Howdy</span>
   </update>
 </updates>




                                                     www.icefaces.org
webmc.jspx
 <f:view xmlns:f=quot;http://java.sun.com/jsf/corequot;
          xmlns:h=quot;http://java.sun.com/jsf/htmlquot;>
 <html>
   <head> <title>WebMC</title> </head>
   <body>
     <h3>WebMC</h3>
     <h:form>
        <h:panelGrid columns=quot;1quot;>
          <h:outputText value=quot;Presentationquot;/>
          <h:graphicImage value=quot;#{user.slideURL}quot;/>
        </h:panelGrid>
        <h:panelGrid columns=quot;1quot; >
          <h:outputText value=quot;Chatquot;/>
          <h:outputText value=quot;#{user.chatLog}quot;/>
          <h:inputText value=quot;#{user.chatInput}quot;/>
          <h:commandButton actionListener=quot;#{user.submit}quot;/>
        </h:panelGrid>


                                       www.icefaces.org
UserBean.java
    public class UserBean {

        public String getSlideURL() {
                                         Set by presentation moderator
            return slideURL;
                                         slide controls
        }

        public String getChatLog() {
            return chatLog;
        }

        public String getChatInput() {
            return chatInput;
        }

        public void setChatInput(String text) {
            chatInput = text;
            append(chatLog, text);
        }
    }

                                          www.icefaces.org
UserBean.java (Ajax Push)

import com.icesoft.faces.async.render.SessionRenderer;

public class UserBean {
    String presentationName;

    public UserBean() {
        presentationName = LoginBean.getPresentationName();
        SessionRenderer.addCurrentSession(presentationName);
    }

    public void submit() {
        SessionRenderer.render(presentationName);
    }
}




                                       www.icefaces.org
Ajax Components with ICEfaces


 • Automatic Ajax updates
 • No JavaScript Development
 • Easy Ajax Component Suite
    – No JavaScript component wiring
    – No manually defined update regions
 • Ajax transport handled by ICEfaces
 • Woodstock conversion: utilities and compatible components
 • ---
    – Asynchronous application-driven browser updates
    – All 50+ components are Ajax Push aware




                                                www.icefaces.org
A Thread for Every Client?




• Blocking requests with Servlet 2.5 consumes threads

• GlassFish/Grizzly, Tomcat 6, Jetty, and Servlet 3.0
  provide asynchronous request processing

• Many connections handled with a small thread pool


                                        www.icefaces.org
GlassFish
 Suspend with Grizzly.
      CometContext context =
          CometEngine.getEngine().register(contextPath);
      context.setExpirationDelay(20 * 1000);
      SuspendableHandler handler = new SuspendableHandler();
      handler.attach(response);
      cometContext.addCometHandler(handler);

  class SuspendableHandler implements CometHandler {
      public void onEvent(CometEvent event) {
      response.getWriter().println(event.attachment());
      cometContext.resumeCometHandler(this);
  }
Asynchronously and elsewhere in the application ...
  presentation.setSlide(7);
  cometContext.notify(message);


                                        www.icefaces.org
Multiple Applications and Browser Connection Limits
                 http:// host / ajaxpush /




                              Asynchronous
                               Connections
        Glassfish


                             Grizzly


                            Ajax Push
                              Server


               ICEfaces                       ICEfaces
                              JMS
              Application                    Application




                                                www.icefaces.org
Security for Ajax Push

 • Build security in layers
    – Java
    – JavaServer Faces
    – SSL

 • Script injection
    – JavaScript
    – SQL

 • Cross-site request forgery
 • Cross-site scripting

                                www.icefaces.org
Custom Components (JSF 1.2)


 • Implement MyComponent.java extending UIInput

 • Implement MyComponentRenderer.java

 • Implement MyComponentTag.java

 • Add component and renderer to faces-config.xml

 • Add MyComponentTag to TLD



                                    www.icefaces.org
Facelets in JSF 2

  • Facelets now part of JSF standard
  • Also know as the Page Declaration Language (PDL)‫‏‬
  • First non-JSP PDL designed for JSF
  • Some differences from JSP:
     – Pages compiled to abstract structure
     – Builds JSF component view when executed
     – Don't need TLD for tag attributes
     – Page templating


  • Opens the door for easier component development



                                              www.icefaces.org
Custom Components in JSF 2

 • Components built via markup templates
 • Also known as composite components
 • Composite Component: any Facelet markup file that
   resides in a resource library


 • Custom components can also be developed in Java as
   per JSF 1.2




                                    www.icefaces.org
Custom Components in JSF 2 (Use)




                                   www.icefaces.org
Custom Components in JSF 2 (Definition)




                                 www.icefaces.org
Ajax in JSF 2.0

  • Resource Delivery Mechanism
  • Partial View Processing
  • Partial View Rendering
  • Ajax Client/Server
                                  In JSF 2.0 Spec

                                  In Component Library
  • Ajax Enabled Components




                                   www.icefaces.org
Ajax in JSF 2

Partial View Processing
 Ajax Request
 execute:4,5
                               Apply Request              Process
                Restore View
                                                         Validations
                                    Values




                  Render          Invoke                Update Model
      1          Response       Application                Values


  2       3

                                              Execute Portion
  4       5


                                                www.icefaces.org
Ajax in JSF 2

Partial View Rendering
 Ajax Request
 render:4,5
                                 Apply Request             Process
                  Restore View
                                                          Validations
                                      Values




                    Render          Invoke               Update Model
      1            Response       Application               Values


  2       3

                Render Portion
  4       5


                                                 www.icefaces.org
Ajax in JSF 2
  • Standard JavaScript API
     – jsf.ajax.request, jsf.ajax.response
     – jsf.ajax.addOnError, jsf.ajax.addOnEvent
     – jsf.getProjectStage, jsf.getViewState
  • Standard Response Format
     – XML based
     – “instruction set” for:
         – updating DOM, attribute changes, script execution
         – inserting into DOM, deleting DOM nodes, extensions
  • Standard Subtree Execution and Rendering
     – frameworks may also plug in their own traversal strategy
  • Declarative Ajax (f:ajax)‫‏‬
  • Net result is Ajax component interoperability

                                              www.icefaces.org
Enhancements in JSF 2
 • System Events
    – Represent specific points in time for a JSF application
    – For example, listen for:
        – when a component was added to parent
        – when a component is about to be rendered
    – Listeners implement javax.faces.event.SystemEventListener
 • “view” scope
    – allows attributes to be associated with a view
    – attributes persist until a new view is navigated to
    – can be accessed via EL (like request or session)‫‏‬
 • Annotations
    – An alternative to XML configuration
    – @FacesComponent, @FacesConverter, @ManagedBean
    – @RequestScoped, @SessionScoped, @ApplicationScoped

                                               www.icefaces.org
Enhancements in JSF 2
 • Resources
    – Facility for serving resources (CSS, JavaScript, images, etc..)‫‏‬
    – Can be packaged under web application
       – Under “resources” directory
       – Or into classpath under META-INF/resources
    – Typically reside in libraries
    – Resources can be versioned


 • Exceptions
    – Exception handling facility allows queuing of exceptions
    – Also leverages System Event facility
    – publish ExceptionEvent(s); subscribe to ExceptionEvent(s)‫‏‬




                                                www.icefaces.org
Summary
The Asynchronous Web Revolution is Now
   • Ajax Push will revolutionize human interaction

   • Ajax Push is the key to enterprise collaboration for the
     Web

   • JSF 2.0 is the language for developing web applications

   • Ajax Push can scale on GlassFish with Asynchronous
     Request Processing

   • ICEfaces provides the high-level capabilities for
     enterprise collaboration features in your application

                                           www.icefaces.org
                                                www.icefaces.org
ICESOFT TECHNOLOGIES INC.
Thank You




            Contact Us:
            Toll Free: +1 877 263 3822 USA
            International: +1 403 663 3322
            product.support@icesoft.com




                                www.icefaces.org
                                                   44

Más contenido relacionado

La actualidad más candente

Aligning Ember.js with Web Standards
Aligning Ember.js with Web StandardsAligning Ember.js with Web Standards
Aligning Ember.js with Web StandardsMatthew Beale
 
Building Realtime Apps with Ember.js and WebSockets
Building Realtime Apps with Ember.js and WebSocketsBuilding Realtime Apps with Ember.js and WebSockets
Building Realtime Apps with Ember.js and WebSocketsBen Limmer
 
Wicket Presentation @ AlphaCSP Java Web Frameworks Playoff 2008
Wicket Presentation @ AlphaCSP Java Web Frameworks Playoff 2008Wicket Presentation @ AlphaCSP Java Web Frameworks Playoff 2008
Wicket Presentation @ AlphaCSP Java Web Frameworks Playoff 2008Baruch Sadogursky
 
Developing High Performance Web Apps
Developing High Performance Web AppsDeveloping High Performance Web Apps
Developing High Performance Web AppsTimothy Fisher
 
Rails for Mobile Devices @ Conferencia Rails 2011
Rails for Mobile Devices @ Conferencia Rails 2011Rails for Mobile Devices @ Conferencia Rails 2011
Rails for Mobile Devices @ Conferencia Rails 2011Alberto Perdomo
 
Vaadin7
Vaadin7Vaadin7
Vaadin7jojule
 
JS Lab`16. Владимир Воевидка: "Как работает браузер"
JS Lab`16. Владимир Воевидка: "Как работает браузер"JS Lab`16. Владимир Воевидка: "Как работает браузер"
JS Lab`16. Владимир Воевидка: "Как работает браузер"GeeksLab Odessa
 
Tuning Web Performance
Tuning Web PerformanceTuning Web Performance
Tuning Web PerformanceEric ShangKuan
 
High Performance Ajax Applications
High Performance Ajax ApplicationsHigh Performance Ajax Applications
High Performance Ajax ApplicationsSiarhei Barysiuk
 
Opening up the Social Web - Standards that are bridging the Islands
Opening up the Social Web - Standards that are bridging the IslandsOpening up the Social Web - Standards that are bridging the Islands
Opening up the Social Web - Standards that are bridging the IslandsBastian Hofmann
 
How to Develop a Rich, Native-quality User Experience for Mobile Using Web St...
How to Develop a Rich, Native-quality User Experience for Mobile Using Web St...How to Develop a Rich, Native-quality User Experience for Mobile Using Web St...
How to Develop a Rich, Native-quality User Experience for Mobile Using Web St...David Kaneda
 
HTML5 and the dawn of rich mobile web applications pt 1
HTML5 and the dawn of rich mobile web applications pt 1HTML5 and the dawn of rich mobile web applications pt 1
HTML5 and the dawn of rich mobile web applications pt 1James Pearce
 
Operacion Guinda 2
Operacion Guinda 2Operacion Guinda 2
Operacion Guinda 2Red RADAR
 
HTML5, The Open Web, and what it means for you - MDN Hack Day, Sao Paulo
HTML5, The Open Web, and what it means for you - MDN Hack Day, Sao PauloHTML5, The Open Web, and what it means for you - MDN Hack Day, Sao Paulo
HTML5, The Open Web, and what it means for you - MDN Hack Day, Sao PauloRobert Nyman
 
Internet Explorer 8 for Developers by Christian Thilmany
Internet Explorer 8 for Developers by Christian ThilmanyInternet Explorer 8 for Developers by Christian Thilmany
Internet Explorer 8 for Developers by Christian ThilmanyChristian Thilmany
 
Week 05 Web, App and Javascript_Brandon, S.H. Wu
Week 05 Web, App and Javascript_Brandon, S.H. WuWeek 05 Web, App and Javascript_Brandon, S.H. Wu
Week 05 Web, App and Javascript_Brandon, S.H. WuAppUniverz Org
 
Comment j'ai mis ma suite de tests au régime en 5 minutes par jour
Comment j'ai mis ma suite de tests au régime en 5 minutes par jourComment j'ai mis ma suite de tests au régime en 5 minutes par jour
Comment j'ai mis ma suite de tests au régime en 5 minutes par jourCARA_Lyon
 

La actualidad más candente (20)

Aligning Ember.js with Web Standards
Aligning Ember.js with Web StandardsAligning Ember.js with Web Standards
Aligning Ember.js with Web Standards
 
Building Realtime Apps with Ember.js and WebSockets
Building Realtime Apps with Ember.js and WebSocketsBuilding Realtime Apps with Ember.js and WebSockets
Building Realtime Apps with Ember.js and WebSockets
 
Wicket Presentation @ AlphaCSP Java Web Frameworks Playoff 2008
Wicket Presentation @ AlphaCSP Java Web Frameworks Playoff 2008Wicket Presentation @ AlphaCSP Java Web Frameworks Playoff 2008
Wicket Presentation @ AlphaCSP Java Web Frameworks Playoff 2008
 
Developing High Performance Web Apps
Developing High Performance Web AppsDeveloping High Performance Web Apps
Developing High Performance Web Apps
 
Rails for Mobile Devices @ Conferencia Rails 2011
Rails for Mobile Devices @ Conferencia Rails 2011Rails for Mobile Devices @ Conferencia Rails 2011
Rails for Mobile Devices @ Conferencia Rails 2011
 
Vaadin7
Vaadin7Vaadin7
Vaadin7
 
JS Lab`16. Владимир Воевидка: "Как работает браузер"
JS Lab`16. Владимир Воевидка: "Как работает браузер"JS Lab`16. Владимир Воевидка: "Как работает браузер"
JS Lab`16. Владимир Воевидка: "Как работает браузер"
 
Tuning Web Performance
Tuning Web PerformanceTuning Web Performance
Tuning Web Performance
 
High Performance Ajax Applications
High Performance Ajax ApplicationsHigh Performance Ajax Applications
High Performance Ajax Applications
 
Opening up the Social Web - Standards that are bridging the Islands
Opening up the Social Web - Standards that are bridging the IslandsOpening up the Social Web - Standards that are bridging the Islands
Opening up the Social Web - Standards that are bridging the Islands
 
How to Develop a Rich, Native-quality User Experience for Mobile Using Web St...
How to Develop a Rich, Native-quality User Experience for Mobile Using Web St...How to Develop a Rich, Native-quality User Experience for Mobile Using Web St...
How to Develop a Rich, Native-quality User Experience for Mobile Using Web St...
 
HTML 5 - Overview
HTML 5 - OverviewHTML 5 - Overview
HTML 5 - Overview
 
HTML5 and the dawn of rich mobile web applications pt 1
HTML5 and the dawn of rich mobile web applications pt 1HTML5 and the dawn of rich mobile web applications pt 1
HTML5 and the dawn of rich mobile web applications pt 1
 
Wicket 2010
Wicket 2010Wicket 2010
Wicket 2010
 
Operacion Guinda 2
Operacion Guinda 2Operacion Guinda 2
Operacion Guinda 2
 
HTML5, The Open Web, and what it means for you - MDN Hack Day, Sao Paulo
HTML5, The Open Web, and what it means for you - MDN Hack Day, Sao PauloHTML5, The Open Web, and what it means for you - MDN Hack Day, Sao Paulo
HTML5, The Open Web, and what it means for you - MDN Hack Day, Sao Paulo
 
Internet Explorer 8 for Developers by Christian Thilmany
Internet Explorer 8 for Developers by Christian ThilmanyInternet Explorer 8 for Developers by Christian Thilmany
Internet Explorer 8 for Developers by Christian Thilmany
 
The State of Wicket
The State of WicketThe State of Wicket
The State of Wicket
 
Week 05 Web, App and Javascript_Brandon, S.H. Wu
Week 05 Web, App and Javascript_Brandon, S.H. WuWeek 05 Web, App and Javascript_Brandon, S.H. Wu
Week 05 Web, App and Javascript_Brandon, S.H. Wu
 
Comment j'ai mis ma suite de tests au régime en 5 minutes par jour
Comment j'ai mis ma suite de tests au régime en 5 minutes par jourComment j'ai mis ma suite de tests au régime en 5 minutes par jour
Comment j'ai mis ma suite de tests au régime en 5 minutes par jour
 

Similar a ICEfaces and JSF 2.0 on GlassFish

IE 8 et les standards du Web - Chris Wilson - Paris Web 2008
IE 8 et les standards du Web - Chris Wilson - Paris Web 2008IE 8 et les standards du Web - Chris Wilson - Paris Web 2008
IE 8 et les standards du Web - Chris Wilson - Paris Web 2008Association Paris-Web
 
Nodejs and WebSockets
Nodejs and WebSocketsNodejs and WebSockets
Nodejs and WebSocketsGonzalo Ayuso
 
KSDG-iSlide App 開發心得分享
KSDG-iSlide App 開發心得分享KSDG-iSlide App 開發心得分享
KSDG-iSlide App 開發心得分享Chia Wei Tsai
 
Beyond Cookies, Persistent Storage For Web Applications Web Directions North ...
Beyond Cookies, Persistent Storage For Web Applications Web Directions North ...Beyond Cookies, Persistent Storage For Web Applications Web Directions North ...
Beyond Cookies, Persistent Storage For Web Applications Web Directions North ...BradNeuberg
 
CTS Conference Web 2.0 Tutorial Part 2
CTS Conference Web 2.0 Tutorial Part 2CTS Conference Web 2.0 Tutorial Part 2
CTS Conference Web 2.0 Tutorial Part 2Geoffrey Fox
 
Orbitz and Spring Webflow Case Study
Orbitz and Spring Webflow Case StudyOrbitz and Spring Webflow Case Study
Orbitz and Spring Webflow Case StudyMark Meeker
 
The Dojo Build System
The Dojo Build SystemThe Dojo Build System
The Dojo Build Systemklipstein
 
Going Live! with Comet
Going Live! with CometGoing Live! with Comet
Going Live! with CometSimon Willison
 
Rob Tweed :: Ajax and the Impact on Caché and Similar Technologies
Rob Tweed :: Ajax and the Impact on Caché and Similar TechnologiesRob Tweed :: Ajax and the Impact on Caché and Similar Technologies
Rob Tweed :: Ajax and the Impact on Caché and Similar Technologiesgeorge.james
 
IPhone Web Development With Grails from CodeMash 2009
IPhone Web Development With Grails from CodeMash 2009IPhone Web Development With Grails from CodeMash 2009
IPhone Web Development With Grails from CodeMash 2009Christopher Judd
 
Ajax Push ICEfaces Ted Goddard
Ajax Push ICEfaces Ted GoddardAjax Push ICEfaces Ted Goddard
Ajax Push ICEfaces Ted Goddardrajivmordani
 
Open Source Ajax Solution @OSDC.tw 2009
Open Source Ajax  Solution @OSDC.tw 2009Open Source Ajax  Solution @OSDC.tw 2009
Open Source Ajax Solution @OSDC.tw 2009Robbie Cheng
 
User Interface Patterns and Nuxeo
User Interface Patterns and NuxeoUser Interface Patterns and Nuxeo
User Interface Patterns and Nuxeoanicewick
 
Ajax to the Moon
Ajax to the MoonAjax to the Moon
Ajax to the Moondavejohnson
 

Similar a ICEfaces and JSF 2.0 on GlassFish (20)

IE 8 et les standards du Web - Chris Wilson - Paris Web 2008
IE 8 et les standards du Web - Chris Wilson - Paris Web 2008IE 8 et les standards du Web - Chris Wilson - Paris Web 2008
IE 8 et les standards du Web - Chris Wilson - Paris Web 2008
 
Jsf Ajax
Jsf AjaxJsf Ajax
Jsf Ajax
 
Nodejs and WebSockets
Nodejs and WebSocketsNodejs and WebSockets
Nodejs and WebSockets
 
KSDG-iSlide App 開發心得分享
KSDG-iSlide App 開發心得分享KSDG-iSlide App 開發心得分享
KSDG-iSlide App 開發心得分享
 
Beyond Cookies, Persistent Storage For Web Applications Web Directions North ...
Beyond Cookies, Persistent Storage For Web Applications Web Directions North ...Beyond Cookies, Persistent Storage For Web Applications Web Directions North ...
Beyond Cookies, Persistent Storage For Web Applications Web Directions North ...
 
CTS Conference Web 2.0 Tutorial Part 2
CTS Conference Web 2.0 Tutorial Part 2CTS Conference Web 2.0 Tutorial Part 2
CTS Conference Web 2.0 Tutorial Part 2
 
Orbitz and Spring Webflow Case Study
Orbitz and Spring Webflow Case StudyOrbitz and Spring Webflow Case Study
Orbitz and Spring Webflow Case Study
 
The Dojo Build System
The Dojo Build SystemThe Dojo Build System
The Dojo Build System
 
Going Live! with Comet
Going Live! with CometGoing Live! with Comet
Going Live! with Comet
 
Ajax World Fall08
Ajax World Fall08Ajax World Fall08
Ajax World Fall08
 
Rob Tweed :: Ajax and the Impact on Caché and Similar Technologies
Rob Tweed :: Ajax and the Impact on Caché and Similar TechnologiesRob Tweed :: Ajax and the Impact on Caché and Similar Technologies
Rob Tweed :: Ajax and the Impact on Caché and Similar Technologies
 
IPhone Web Development With Grails from CodeMash 2009
IPhone Web Development With Grails from CodeMash 2009IPhone Web Development With Grails from CodeMash 2009
IPhone Web Development With Grails from CodeMash 2009
 
Ajax Push ICEfaces Ted Goddard
Ajax Push ICEfaces Ted GoddardAjax Push ICEfaces Ted Goddard
Ajax Push ICEfaces Ted Goddard
 
Time for Comet?
Time for Comet?Time for Comet?
Time for Comet?
 
Jsp
JspJsp
Jsp
 
Socket.io
Socket.ioSocket.io
Socket.io
 
Open Source Ajax Solution @OSDC.tw 2009
Open Source Ajax  Solution @OSDC.tw 2009Open Source Ajax  Solution @OSDC.tw 2009
Open Source Ajax Solution @OSDC.tw 2009
 
Ajax3
Ajax3Ajax3
Ajax3
 
User Interface Patterns and Nuxeo
User Interface Patterns and NuxeoUser Interface Patterns and Nuxeo
User Interface Patterns and Nuxeo
 
Ajax to the Moon
Ajax to the MoonAjax to the Moon
Ajax to the Moon
 

Más de Eduardo Pelegri-Llopart

Pelegri Desarrollando en una nueva era de software
Pelegri   Desarrollando en una nueva era de software Pelegri   Desarrollando en una nueva era de software
Pelegri Desarrollando en una nueva era de software Eduardo Pelegri-Llopart
 
Market trends in IT - exchange cala - October 2015
Market trends in IT - exchange cala - October 2015Market trends in IT - exchange cala - October 2015
Market trends in IT - exchange cala - October 2015Eduardo Pelegri-Llopart
 
The impact of IOT - exchange cala - 2015
The impact of IOT - exchange cala - 2015The impact of IOT - exchange cala - 2015
The impact of IOT - exchange cala - 2015Eduardo Pelegri-Llopart
 
What is IoT and how Modulus and Pacific can Help - Featuring Node.js and Roll...
What is IoT and how Modulus and Pacific can Help - Featuring Node.js and Roll...What is IoT and how Modulus and Pacific can Help - Featuring Node.js and Roll...
What is IoT and how Modulus and Pacific can Help - Featuring Node.js and Roll...Eduardo Pelegri-Llopart
 
What is the Internet of Things and How it Impacts You
What is the Internet of Things and How it Impacts YouWhat is the Internet of Things and How it Impacts You
What is the Internet of Things and How it Impacts YouEduardo Pelegri-Llopart
 
Ehcache Architecture, Features And Usage Patterns
Ehcache Architecture, Features And Usage PatternsEhcache Architecture, Features And Usage Patterns
Ehcache Architecture, Features And Usage PatternsEduardo Pelegri-Llopart
 

Más de Eduardo Pelegri-Llopart (20)

Juggling at freenome
Juggling   at freenomeJuggling   at freenome
Juggling at freenome
 
Csumb capstone-fall2016
Csumb capstone-fall2016Csumb capstone-fall2016
Csumb capstone-fall2016
 
Digital activitymanagement
Digital activitymanagementDigital activitymanagement
Digital activitymanagement
 
Progress next iot_pelegri
Progress next iot_pelegriProgress next iot_pelegri
Progress next iot_pelegri
 
Pelegri Desarrollando en una nueva era de software
Pelegri   Desarrollando en una nueva era de software Pelegri   Desarrollando en una nueva era de software
Pelegri Desarrollando en una nueva era de software
 
Market trends in IT - exchange cala - October 2015
Market trends in IT - exchange cala - October 2015Market trends in IT - exchange cala - October 2015
Market trends in IT - exchange cala - October 2015
 
The impact of IOT - exchange cala - 2015
The impact of IOT - exchange cala - 2015The impact of IOT - exchange cala - 2015
The impact of IOT - exchange cala - 2015
 
IOT - Presentation to PEP @ Progress
IOT - Presentation to PEP @ ProgressIOT - Presentation to PEP @ Progress
IOT - Presentation to PEP @ Progress
 
Node.js as an IOT Bridge
Node.js as an IOT BridgeNode.js as an IOT Bridge
Node.js as an IOT Bridge
 
What is IoT and how Modulus and Pacific can Help - Featuring Node.js and Roll...
What is IoT and how Modulus and Pacific can Help - Featuring Node.js and Roll...What is IoT and how Modulus and Pacific can Help - Featuring Node.js and Roll...
What is IoT and how Modulus and Pacific can Help - Featuring Node.js and Roll...
 
What is the Internet of Things and How it Impacts You
What is the Internet of Things and How it Impacts YouWhat is the Internet of Things and How it Impacts You
What is the Internet of Things and How it Impacts You
 
Community Update 25 Mar2010 - English
Community Update 25 Mar2010 - EnglishCommunity Update 25 Mar2010 - English
Community Update 25 Mar2010 - English
 
GlassFish Community Update 25 Mar2010
GlassFish Community Update 25 Mar2010GlassFish Community Update 25 Mar2010
GlassFish Community Update 25 Mar2010
 
Glass Fish Portfolio C1 West V3.Mini
Glass Fish Portfolio C1 West V3.MiniGlass Fish Portfolio C1 West V3.Mini
Glass Fish Portfolio C1 West V3.Mini
 
Virtual Box Aquarium May09
Virtual Box Aquarium May09Virtual Box Aquarium May09
Virtual Box Aquarium May09
 
Introduction To Web Beans
Introduction To Web BeansIntroduction To Web Beans
Introduction To Web Beans
 
Ehcache Architecture, Features And Usage Patterns
Ehcache Architecture, Features And Usage PatternsEhcache Architecture, Features And Usage Patterns
Ehcache Architecture, Features And Usage Patterns
 
OpenDS Primer Aquarium
OpenDS Primer AquariumOpenDS Primer Aquarium
OpenDS Primer Aquarium
 
Fuji Overview
Fuji OverviewFuji Overview
Fuji Overview
 
Nuxeo 5.2 Glassfish
Nuxeo 5.2 GlassfishNuxeo 5.2 Glassfish
Nuxeo 5.2 Glassfish
 

Último

Connecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdfConnecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdfNeo4j
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsPixlogix Infotech
 
Generative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdfGenerative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdfIngrid Airi González
 
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
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxLoriGlavin3
 
So einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdfSo einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdfpanagenda
 
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
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
Assure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyesAssure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyesThousandEyes
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxLoriGlavin3
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024Lonnie McRorey
 
[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality Assurance[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality AssuranceInflectra
 
Testing tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examplesTesting tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examplesKari Kakkonen
 
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Alkin Tezuysal
 
Time Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsTime Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsNathaniel Shimoni
 
Manual 508 Accessibility Compliance Audit
Manual 508 Accessibility Compliance AuditManual 508 Accessibility Compliance Audit
Manual 508 Accessibility Compliance AuditSkynet Technologies
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxLoriGlavin3
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteDianaGray10
 
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
 

Último (20)

Connecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdfConnecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdf
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and Cons
 
Generative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdfGenerative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdf
 
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
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
 
So einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdfSo einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdf
 
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
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
Assure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyesAssure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyes
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024
 
[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality Assurance[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality Assurance
 
Testing tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examplesTesting tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examples
 
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
 
Time Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsTime Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directions
 
Manual 508 Accessibility Compliance Audit
Manual 508 Accessibility Compliance AuditManual 508 Accessibility Compliance Audit
Manual 508 Accessibility Compliance Audit
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test Suite
 
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...
 

ICEfaces and JSF 2.0 on GlassFish

  • 2. ICEfaces is… ICEfaces is an Ajax framework that allows developers to easily create rich Internet applications (RIA) in pure Java. • Open source • Standards-based • Extends JavaServer Faces • Develop rich Web Applications in pure Java, not JavaScript • Integrated with GlassFish and Friends – Provides NetBeans IDE Plugin • Endorsed migration for Woodstock users – Supports Ajax Push applications via Grizzly – Leverages enterprise capabilities of GlassFish • Security, Scalability: Clustering, Load Balancing and Failover – Integrates with 3rd Party frameworks and middleware • WebSpace, WebStack Easy Ajax for Java developers www.icefaces.org
  • 3. Agenda • Ajax Push Overview • Application Programming Basics • On the Wire • Code Walkthrough • Asynchronous Request Processing • Security • Custom Components (JSF 1.2 and JSF 2.0) • JSF 2.0 Ajax • JSF 2.0 Notable Enhancements • Summary www.icefaces.org
  • 4. Multi-user AuctionMonitor www.icefaces.org
  • 5. Multi-user AuctionMonitor www.icefaces.org
  • 6. Multi-user AuctionMonitor www.icefaces.org
  • 7. Multi-user Locking Ted selects record for editing www.icefaces.org
  • 8. Multi-user Locking Joe selects same record, requests lock www.icefaces.org
  • 9. Multi-user Locking Ted responds, and accepts or denies www.icefaces.org
  • 10. Push in Portlets Portal page with three portlets www.icefaces.org
  • 11. Push in Portlets Joe searches for a city www.icefaces.org
  • 12. Push in Portlets All three portlets are updated www.icefaces.org
  • 13. Ajax Push Illustrated Ted Server Deryk www.icefaces.org
  • 14. Ajax Push Illustrated Ajax Request Ted Server Deryk www.icefaces.org
  • 15. Ajax Push Illustrated JSF Lifecycle + DOM diff Ted Server Deryk www.icefaces.org
  • 16. Ajax Push Illustrated Ajax Response Ted Server Ajax Push Deryk www.icefaces.org
  • 17. What is Ajax Push For? • Distance learning • Collaborative authoring • Auctions • Shared WebDAV filesystem • Blogging and reader comments • SIP-coordinated mobile applications • Hybrid chat/email/discussion forums • Customer assistance on sales/support pages • Multi-step business process made collaborative • Shared trip planner or restaurant selector with maps • Shared calendar, “to do” list, project plan • Games • Enterprise shared record locking and negotiation www.icefaces.org
  • 18. Ajax Programming, Ideally. PageBean.java Page.xhtml <f:view public class PageBean { xmlns:f=“http://java.sun.com/jsf/core” String message; xmlns:h=quot;http://java.sun.com/jsf/html“ > public String getMessage() { <html> return message; <body> } <h:form> <h:inputText public void value=“#{pageBean.message}” /> setMessage(String message) { </h:form> this.message = message; </body> } </html> } </f:view> Presentation Model Declarative User Interface www.icefaces.org
  • 19. Ajax Push Programming To keep track of groups of users: SessionRenderer.addCurrentSession(“GlassFishTV”); Asynchronously and elsewhere in the application ... presentation.setSlide(7); SessionRenderer.render(“GlassFishTV”); www.icefaces.org
  • 20. Ajax Push Techniques • Poll – send a request to the server at some interval – response is “empty” if there is no update • Http Streaming – send a request and wait for response – write “endless” response in chunks • Long Poll – send a request to the server and wait for response – indistinguishable from “slow” server www.icefaces.org
  • 21. Long Polling over HTTP GET /auctionMonitor/block/receive-updates?icefacesID=1209765435 HTTP/1.1 Accept: */* Cookie: JSESSIONID=75CF2BF3E03F0F9C6D2E8EFE1A6884F4 Connection: keep-alive Host: vorlon.ice:18080 www.icefaces.org
  • 22. Long Polling over HTTP GET /auctionMonitor/block/receive-updates?icefacesID=1209765435 HTTP/1.1 Accept: */* Cookie: JSESSIONID=75CF2BF3E03F0F9C6D2E8EFE1A6884F4 Connection: keep-alive Host: vorlon.ice:18080 Chat message “Howdy” www.icefaces.org
  • 23. Long Polling over HTTP GET /auctionMonitor/block/receive-updates?icefacesID=1209765435 HTTP/1.1 Accept: */* Cookie: JSESSIONID=75CF2BF3E03F0F9C6D2E8EFE1A6884F4 Connection: keep-alive Host: vorlon.ice:18080 Chat message “Howdy” HTTP/1.1 200 OK Content-Type: text/xml;charset=UTF-8 Content-Length: 180 Date: Tue, 10 Mar 2009 22:49:49 GMT Server: Sun Java System Application Server 9.1_01 <updates> <update address=quot;_id0:_id5:0:chatTextquot;> <span id=quot;_id0:_id5:0:chatTextquot;>Howdy</span> </update> </updates> www.icefaces.org
  • 24. webmc.jspx <f:view xmlns:f=quot;http://java.sun.com/jsf/corequot; xmlns:h=quot;http://java.sun.com/jsf/htmlquot;> <html> <head> <title>WebMC</title> </head> <body> <h3>WebMC</h3> <h:form> <h:panelGrid columns=quot;1quot;> <h:outputText value=quot;Presentationquot;/> <h:graphicImage value=quot;#{user.slideURL}quot;/> </h:panelGrid> <h:panelGrid columns=quot;1quot; > <h:outputText value=quot;Chatquot;/> <h:outputText value=quot;#{user.chatLog}quot;/> <h:inputText value=quot;#{user.chatInput}quot;/> <h:commandButton actionListener=quot;#{user.submit}quot;/> </h:panelGrid> www.icefaces.org
  • 25. UserBean.java public class UserBean { public String getSlideURL() { Set by presentation moderator return slideURL; slide controls } public String getChatLog() { return chatLog; } public String getChatInput() { return chatInput; } public void setChatInput(String text) { chatInput = text; append(chatLog, text); } } www.icefaces.org
  • 26. UserBean.java (Ajax Push) import com.icesoft.faces.async.render.SessionRenderer; public class UserBean { String presentationName; public UserBean() { presentationName = LoginBean.getPresentationName(); SessionRenderer.addCurrentSession(presentationName); } public void submit() { SessionRenderer.render(presentationName); } } www.icefaces.org
  • 27. Ajax Components with ICEfaces • Automatic Ajax updates • No JavaScript Development • Easy Ajax Component Suite – No JavaScript component wiring – No manually defined update regions • Ajax transport handled by ICEfaces • Woodstock conversion: utilities and compatible components • --- – Asynchronous application-driven browser updates – All 50+ components are Ajax Push aware www.icefaces.org
  • 28. A Thread for Every Client? • Blocking requests with Servlet 2.5 consumes threads • GlassFish/Grizzly, Tomcat 6, Jetty, and Servlet 3.0 provide asynchronous request processing • Many connections handled with a small thread pool www.icefaces.org
  • 29. GlassFish Suspend with Grizzly. CometContext context = CometEngine.getEngine().register(contextPath); context.setExpirationDelay(20 * 1000); SuspendableHandler handler = new SuspendableHandler(); handler.attach(response); cometContext.addCometHandler(handler); class SuspendableHandler implements CometHandler { public void onEvent(CometEvent event) { response.getWriter().println(event.attachment()); cometContext.resumeCometHandler(this); } Asynchronously and elsewhere in the application ... presentation.setSlide(7); cometContext.notify(message); www.icefaces.org
  • 30. Multiple Applications and Browser Connection Limits http:// host / ajaxpush / Asynchronous Connections Glassfish Grizzly Ajax Push Server ICEfaces ICEfaces JMS Application Application www.icefaces.org
  • 31. Security for Ajax Push • Build security in layers – Java – JavaServer Faces – SSL • Script injection – JavaScript – SQL • Cross-site request forgery • Cross-site scripting www.icefaces.org
  • 32. Custom Components (JSF 1.2) • Implement MyComponent.java extending UIInput • Implement MyComponentRenderer.java • Implement MyComponentTag.java • Add component and renderer to faces-config.xml • Add MyComponentTag to TLD www.icefaces.org
  • 33. Facelets in JSF 2 • Facelets now part of JSF standard • Also know as the Page Declaration Language (PDL)‫‏‬ • First non-JSP PDL designed for JSF • Some differences from JSP: – Pages compiled to abstract structure – Builds JSF component view when executed – Don't need TLD for tag attributes – Page templating • Opens the door for easier component development www.icefaces.org
  • 34. Custom Components in JSF 2 • Components built via markup templates • Also known as composite components • Composite Component: any Facelet markup file that resides in a resource library • Custom components can also be developed in Java as per JSF 1.2 www.icefaces.org
  • 35. Custom Components in JSF 2 (Use) www.icefaces.org
  • 36. Custom Components in JSF 2 (Definition) www.icefaces.org
  • 37. Ajax in JSF 2.0 • Resource Delivery Mechanism • Partial View Processing • Partial View Rendering • Ajax Client/Server In JSF 2.0 Spec In Component Library • Ajax Enabled Components www.icefaces.org
  • 38. Ajax in JSF 2 Partial View Processing Ajax Request execute:4,5 Apply Request Process Restore View Validations Values Render Invoke Update Model 1 Response Application Values 2 3 Execute Portion 4 5 www.icefaces.org
  • 39. Ajax in JSF 2 Partial View Rendering Ajax Request render:4,5 Apply Request Process Restore View Validations Values Render Invoke Update Model 1 Response Application Values 2 3 Render Portion 4 5 www.icefaces.org
  • 40. Ajax in JSF 2 • Standard JavaScript API – jsf.ajax.request, jsf.ajax.response – jsf.ajax.addOnError, jsf.ajax.addOnEvent – jsf.getProjectStage, jsf.getViewState • Standard Response Format – XML based – “instruction set” for: – updating DOM, attribute changes, script execution – inserting into DOM, deleting DOM nodes, extensions • Standard Subtree Execution and Rendering – frameworks may also plug in their own traversal strategy • Declarative Ajax (f:ajax)‫‏‬ • Net result is Ajax component interoperability www.icefaces.org
  • 41. Enhancements in JSF 2 • System Events – Represent specific points in time for a JSF application – For example, listen for: – when a component was added to parent – when a component is about to be rendered – Listeners implement javax.faces.event.SystemEventListener • “view” scope – allows attributes to be associated with a view – attributes persist until a new view is navigated to – can be accessed via EL (like request or session)‫‏‬ • Annotations – An alternative to XML configuration – @FacesComponent, @FacesConverter, @ManagedBean – @RequestScoped, @SessionScoped, @ApplicationScoped www.icefaces.org
  • 42. Enhancements in JSF 2 • Resources – Facility for serving resources (CSS, JavaScript, images, etc..)‫‏‬ – Can be packaged under web application – Under “resources” directory – Or into classpath under META-INF/resources – Typically reside in libraries – Resources can be versioned • Exceptions – Exception handling facility allows queuing of exceptions – Also leverages System Event facility – publish ExceptionEvent(s); subscribe to ExceptionEvent(s)‫‏‬ www.icefaces.org
  • 43. Summary The Asynchronous Web Revolution is Now • Ajax Push will revolutionize human interaction • Ajax Push is the key to enterprise collaboration for the Web • JSF 2.0 is the language for developing web applications • Ajax Push can scale on GlassFish with Asynchronous Request Processing • ICEfaces provides the high-level capabilities for enterprise collaboration features in your application www.icefaces.org www.icefaces.org ICESOFT TECHNOLOGIES INC.
  • 44. Thank You Contact Us: Toll Free: +1 877 263 3822 USA International: +1 403 663 3322 product.support@icesoft.com www.icefaces.org 44