Primefaces Cookbook Second Edition

Total Page:16

File Type:pdf, Size:1020Kb

Primefaces Cookbook Second Edition www.allitebooks.com PrimeFaces Cookbook Second Edition Over 100 practical recipes to learn PrimeFaces 5.x – the most popular JSF component library on the planet Mert Çalışkan Oleg Varaksin BIRMINGHAM - MUMBAI www.allitebooks.com PrimeFaces Cookbook Second Edition Copyright © 2015 Packt Publishing All rights reserved. No part of this book may be reproduced, stored in a retrieval system, or transmitted in any form or by any means, without the prior written permission of the publisher, except in the case of brief quotations embedded in critical articles or reviews. Every effort has been made in the preparation of this book to ensure the accuracy of the information presented. However, the information contained in this book is sold without warranty, either express or implied. Neither the authors, nor Packt Publishing, and its dealers and distributors will be held liable for any damages caused or alleged to be caused directly or indirectly by this book. Packt Publishing has endeavored to provide trademark information about all of the companies and products mentioned in this book by the appropriate use of capitals. However, Packt Publishing cannot guarantee the accuracy of this information. First published: January 2013 Second edition: May 2015 Production reference: 1250515 Published by Packt Publishing Ltd. Livery Place 35 Livery Street Birmingham B3 2PB, UK. ISBN 978-1-78439-342-7 www.packtpub.com www.allitebooks.com Credits Authors Copy Editors Mert Çalışkan Sarang Chari Oleg Varaksin Sonia Mathur Reviewers Project Coordinator Ramanath Bhongale Harshal Ved Aristides Villarreal Bravo Sebastian D'Agostino Proofreaders Stephen Copestake Commissioning Editor Safis Editing Akram Hussain Indexer Acquisition Editors Mariammal Chettiyar Tushar Gupta Llewellyn Rozario Production Coordinator Conidon Miranda Content Development Editor Ajinkya Paranjape Cover Work Conidon Miranda Technical Editor Humera Shaikh www.allitebooks.com Foreword JavaServer Faces has come a long way since its initial release. This is mostly due to the big ecosystem around it that allows many third-party add-ons to contribute. The first major extension was Facelets that removed the burden of JSP-based views. With 2.0, Facelets became standard, and along with Facelets, many other features, including AJAX, originated from the community. JSF 2.2 followed the same approach and integrated various enhancements, such as HTML5-friendly markup, resource library contracts, and Faces Flows. Considering the current landspace of modern web application development, a server-side component framework such as JSF is still a popular choice among Java developers; this is because JSF is flexible enough to keep up. I started PrimeFaces back in 2009 to provide a new alternative component suite to the JSF ecosystem. As of now, PrimeFaces is the most popular framework and the de facto standard for JSF applications built with Java EE. During this time, the component suite has extended to an over-100-rich suite of components utilizing modern JavaScript and CSS techniques, integrating responsive design, and providing mobile and push modules. PrimeFaces is documented well in PrimeFaces User Guide, and Showcase is considered to be a practical guide in itself. However, there are many cases that can only be seen when doing actual development and are not to be found in the guide or Showcase. PrimeFaces Cookbook, Second Edition, focuses on these cases in a practical way to provide best practices as solutions to common requirements. I've known Mert and Oleg for a long time; both are power users of PrimeFaces and longtime contributors to the framework. Their expertise in PrimeFaces makes this book a great complementary resource when developing applications with PrimeFaces. Çağatay Çivici Founder and Lead Developer of PrimeFaces www.allitebooks.com Foreword I consider it a great blessing to have been associated with the JavaServer Faces technology for such a long time. In the 11 years since JSF 1.0 was released, the little corner of the enterprise software world in which JSF plays has experienced an enormous amount of growth and change, but it is still the world of enterprise software. During this time, I have come to have a deep appreciation of the unique technical and nontechnical requirements of enterprise software. This appreciation has shown me that these two aspects are very closely linked, and any framework that wants to play in the enterprise software space must broadly and deeply address both of them. The fact that there is still demand for the continued evolution of JSF is a testament to the ecosystem behind JSF and also how well it addresses these aspects. One of the key nontechnical requirements of enterprise software is the ability to build projects that have very long service lifetimes. To do this, enterprises need technologies that are good enough to get the job done while having the necessary market backing and support guarantees to be trusted with mission-critical applications. This is where Java lives and thrives, and the Java Community Process (JCP) is the engine to develop Java. There is a tension between the long service lifetime requirement of enterprise software and the constantly evolving state of the art. One element of this evolution is the rise and acceptance of open source software (OSS). When JSF first came out, enterprises looked at open source with a high degree of suspicion. Can we trust it? Will it be there for us throughout the service life for which we need it? Over time, enterprises have come to accept OSS. As the first part of Java to be made open source, JSF has ridden the crest of this trend. This was entirely enabled by the evolution of the JCP with which JSF is developed. Without the opening of the JCP to the ideas of OSS, JSF would have already faded out into nonuse. One could argue that the JCP has helped make OSS for enterprises. www.allitebooks.com The opening of the JCP was also a key enabler for the creation of the JSF component ecosystem, in which PrimeFaces is now the biggest player. I'm very grateful to all of the component libraries in the JSF ecosystem, in particular to PrimeFaces, for taking the core ideas of JSF and building on them to create solutions that can ultimately deliver real business value. Just as PrimeFaces takes the core ideas of JSF, Mert's and Oleg's book takes the core ideas of PrimeFaces and puts them in your hands for quick and easy deployment in your applications. These ideas are presented with frequent How to do it… and How it works… sections, showing first the practice and then the theory of PrimeFaces. With this style of presentation, Mert and Oleg cover the breadth and depth of PrimeFaces, diving down to the core underlying JSF when necessary to drive the point home. I'm confident you'll find the second edition of this book a valuable resource as you develop JSF applications with PrimeFaces. Ed Burns JavaServer Faces Specification Co-lead www.allitebooks.com About the Authors Mert Çalışkan is a software stylist living in Ankara, Turkey. He has more than 10 years of expertise in software development with the architectural design of Enterprise Java web applications. He is an advocate of open source for software projects such as PrimeFaces and has also been a committer and founder of various others. He is the coauthor of the first edition of this book. He is also the coauthor ofBeginning Spring by Wiley Publications. He is the founder of AnkaraJUG, which is the most active JUG in Turkey that has been having monthly meetups for 3 years now. In 2014, he was entitled a Java Champion for his achievements. He is also a Sun Certified Java professional since 2007. He does part-time lecturing at Hacettepe University on enterprise web application architecture and web services. He shares his knowledge at national and international conferences, such as JDays 2015, JavaOne 2013, JDC2010, and JSFDays'08. You can reach Mert via twitter at @mertcal. First, I would like to thank my friend Oleg Varaksin for joining me on this journey. I would also like to thank Çağatay Çivici and Ed Burns for crowning our book with their forewords—without their ideas and inspiration on the JSF ecosystem, this book wouldn't exist. My thanks also go to Ajinkya Paranjape, content development editor; Humera Shaikh, technical editor; and Llewellyn Rozario, acquisition editor, all from Packt Publishing. I would also like to thank our reviewers, Aristides Villarreal Bravo and Sebastian D'Agostino, for the great job they have done in reviewing this book. These people accompanied us during the entire writing process and made the publication of this book possible with their support, suggestions, and reviews. Last but not least, I would like to thank my mother, my father, my Tuğçe, and especially my beloved fiancé, Funda, who gives me her never ending support and enthusiasm. www.allitebooks.com Oleg Varaksin is a senior software engineer living in the Black Forest, Germany. He is a graduate computer scientist who studied informatics at Russian and German universities. His main occupation and "daily bread" in the last 10 years has consisted of building various web applications based on JSP, JSF, CDI, Spring, web services, REST, jQuery, AngularJS, and HTML5. He has a deep understanding of web usability and accessibility. Oleg is an experienced JSF expert and has been working with the PrimeFaces library since its beginning in 2009. He is also a well-known member of the PrimeFaces community and a cocreator of the PrimeFaces Extensions project on additional JSF components for PrimeFaces. Besides the aforementioned technologies, he has worked as a frontend developer with many other web and JavaScript frameworks—Struts, GWT, Prototype, YUI library, and so on. He also implemented an AJAX framework before all the hype about AJAX began.
Recommended publications
  • JSR 378 Review
    JSR 378 Review January 11, 2017 Neil Griffin Specification Lead Liferay, Inc. About JSR 378 • Title: Portlet 3.0 Bridge for JavaServerTM Faces 2.2 Specification • Goal: To define the requirements for a portlet bridge that enables webapp developers to deploy their JSF applications as portlets with little-to-no modification 2 Introduction • JSR 378 builds on top of JSR 329: Portlet 2.0 Bridge for JSF 1.2 • Portlet 3.0 and JSF 2.2 both target Java EE 7, so the bridge targets Java EE 7 as well • This JSR is not included with the Java EE platform 3 Business/marketing/ecosystem justification • Q: Why do this JSR? • JSR 329 was released in 2011 and the JSF Portlet Bridge has not kept pace with the Portlet and JSF specifications • Account for major version increase from Portlet 2.x to 3.x • Account for major version increase from JSF 1.x to 2.x • Account for minor version increase from JSF 2.0 to 2.2 • Q: What’s the need? • Since JSF and Portlets are both standards-based, developers need a standards-based way to deploy JSF applications as a portlets • Q: How does it fit in to the Java ecosystem? • Integrates javax.faces-api and javax.portlet-api • Java-based portals become a deployment option for JSF applications • Supports a variety of JSF component suites from the ever-vibrant JSF ecosystem • Q: Is the idea ready for standardization? • Standardization began with JSR 329 4 History • JSR Review: 20 Jul, 2015 • JSR Review Ballot: 03 Aug, 2015 • Expert Group Formation Complete: 10 Dec, 2015 • JSR Renewal Ballot: 17 Oct, 2016 Portlet 3.0 Testing
    [Show full text]
  • Glassfish, Primefaces. Building Applications for the Java
    Glassfish, PrimeFaces. Building Applications for the Java Enterprise Edition 6 (code: PRIMEFACES-GLASSFISH) Ask for details Phone +44 203 608 6289 Overview [email protected] At the end of the course participants will be able to build and deploy enterprise web applications based on the Java Enterprise Edition 6. The course strives to be vendor-neutral, so instead of proprietary tools only the official Java EE 6 SDK will be used (comprising of Netbeans IDE and Glassfish server.) In addition to the functional but devoid of eye-candy controls provided by the standard JSF platform, participants will be using rich components from the Primefaces component suite. The training covers the three layers of a typical enterprise application: — domain model, mapped to a relational database, — services implementing the business logic, — rich user interface available via web. Parts of the application are built with three fundamental and a number of supporting technologies: — EJB 3.1 (Enterprise Java Beans), — JSF 2.1 (JavaServer Faces), — JPA 2 (Java Persistence Architecture). — EL, JSR-303, JTA, JNDI, CDI. Knowledge acquired during the training can be applied in any standard Java EE 6 environment, using not only Glassfish, but also JBoss AE, Weblogic, Websphere, TomEE, Resin and any other EE6 certified application server. Also, in addition to Primefaces, any other component suite can be used, such as IceFaces, RichFaces Duration 4 days Agenda 1. High-level overview of the Java EE6 ecosystem, implementations and vendors: — common architecture of EE6-style
    [Show full text]
  • Jsf Richfaces Jar Download
    Jsf richfaces jar download RichFaces Downloads. It is highly recommended to use the latest stable releases as each release contains many bug fixes, features, and updates.​Stable Downloads · ​Archive Releases · ​Development Milestones. Final release, which introduces basic JSF 2 support to the Downloads: 0. Theme Package, Set of provided, and sample page themes, LGPL Download : richfaces «r «Jar File Download. META-INF/resources/ META-INF/resources/ : richfaces «r «Jar File Download. Files contained in : META-INF/ META-INF/ Files contained in : META-INF/ Download : richfaces «r «Jar File Download. META-INF/resources/ Files contained in : META-INF/ META-INF/maven/ The RichFaces Framework and Component Suite. Contains all project specific sources. Files, Download (JAR) ( MB). Repositories, CentralJBoss tories​: ​CentralCentralJBoss Releases. Final. JSF Ajax Framework Implementation Files, Download (JAR) ( MB). Repositories Practical RichFaces (Expert's Voice in Java Technology) (). Download JSF /RichFaces Jars for free. Jar(s) for JSF This project contains all required JAR(s) for JSF and RichFaces Download JAR file jsf-richfaces-spring-boot-starter with all dependencies. Source of jsf-richfaces-spring-boot-starter. These are the files of the artifact jsf-richfaces-spring-boot-starter version from the group ces. Download these version by clicking on the download. Project: ork/richfaces-api, version: Source download: Release date: 6 April richfaces - RichFaces 5 - The next-generation JSF component framework by JBoss, Alternatively, if you are not using maven, you can download the project ZIP. it in my NetBeans project on JSF , many exceptions, many unrecognizable stack traces. Anyway, here are the three needed jars, download them: guava-rjar sacjar.
    [Show full text]
  • Plný Text Práce
    Masarykova univerzita Fakulta}w¡¢£¤¥¦§¨ informatiky !"#$%&'()+,-./012345<yA| Pˇr´ıstupnostwebov´ych aplikac´ı postaven´ych na aplikaˇcn´ıch r´amc´ıch Diplomova´ prace´ Michal Bureˇs Brno, 2013 Prohl´aˇsen´ı Prohlaˇsuji,ˇzetato diplomov´apr´aceje m´ymp˚uvodn´ım autorsk´ymd´ılem, kter´ejsem vypracoval samostatnˇe.Vˇsechny zdroje, prameny a literaturu, kter´ejsem pˇrivypracov´an´ı pouˇz´ıval nebo z nich ˇcerpal,v pr´aciˇr´adnˇecituji s uveden´ım´upln´ehoodkazu na pˇr´ısluˇsn´y zdroj. Vedouc´ı pr´ace: Mgr. LudˇekB´artek,Ph.D. ii Podˇekov´an´ı Chtˇelbych podˇekovat vedouc´ımu pr´aceMgr. Lud’ku B´artkovi za cenn´epˇripom´ınkyk m´e diplomov´epr´aci. iii Shrnut´ı C´ılemt´etopr´aceje zmapovat problematiku pˇr´ıstupnosti webov´ych aplikac´ıvyv´ıjen´ych s pouˇzit´ımaplikaˇcn´ıch r´amc˚u.Pr´acepˇredstavuje pojem pˇr´ıstupnosta pod´av´a´uvod do relevantn´ıch standard˚ua technologi´ıv kontextu Internetu a webov´ych aplikac´ı.N´aslednˇe je definov´anasada krit´eri´ıpro hodnocen´ıaplikaˇcn´ıch r´amc˚uz hlediska podpory tvorby pˇr´ıstupn´ych aplikac´ı.J´adrempr´aceje anal´yzavybran´eskupiny aplikaˇcn´ıch r´amc˚una z´akladˇetˇechto krit´eri´ı.Souˇc´ast´ıpr´acejsou tak´edvˇeuk´azkov´eaplikace, kter´eprakticky demonstruj´ıtechniky pro tvorbu pˇr´ıstupn´ych aplikac´ıv r´amc´ıch Google Web Toolkit a Apache Flex. iv Kl´ıˇcov´aslova pˇr´ıstupnost,webov´eaplikace, asistivn´ıtechnologie, webov´eaplikaˇcn´ır´amce,WAI-ARIA, WCAG, WCAG 2.0, JavaServer Faces, Google Web Toolkit, Cappucino, Flex, Silverlight, JavaFX, JQuery UI v Obsah 1 Uvod´ ......................................... 3 2 Od webovych´ str´anek k aplikac´ım ......................
    [Show full text]
  • JSF + Bootstrap 3 Building a More Responsive Design
    JSF + Bootstrap 3 Building a more responsive design KCDC Presentation Brandon Klimek Thursday, June 25, 2015 at 10:10 am www.sixthpoint.com Agility. Delivered. Titanium Sponsors Platinum Sponsors Gold Sponsors Precursor State of the Web Where are we headed? Why? http://www.wired.com/2015/05/google-now-io/ Agility. Delivered. Agenda Introduction ● Java Server Faces ● Bootstrap 3 ○ Bootstrap CSS grid and other form classes ● Font Awesome ○ Best practice to implement in JSF Leveraging Bootstrap with JSF ● Bootstrap validation using component bindings ● Responsive Bootstrap modals What are they? How do you use them together? Agility. Delivered. Example App Agility. Delivered. Example App Agility. Delivered. Example App Cover best practices Lots of other JSF component libraries ● Bootstrap validation using component bindings ● Primefaces ● Font awesome icons usage ● Icefaces ● Bootstrap CSS grid and other form classes ● Richfaces ● Responsive Bootstrap modals Agility. Delivered. Example App Software Used ● Netbeans 8 ● TomEE 1.7 ● MySQL ● JSF 2.0 ● Deltaspike 1.4 (used for viewscoped) ● Bootstrap 3 ● Font Awesome 4.2 Agility. Delivered. Java Server Faces What is JSF? Java specification for building component-based user interfaces for web applications. It gives you the tools to communicate with java backing beans. JSF has all the javascript behind the scenes, creates the endpoints from JSF managed beans, and wires it all together. A brief history ○ JSF 1.0 - 2004 ■ Starting point, major drawback that got alot of criticism was no inline html
    [Show full text]
  • JSF: an Introducron
    JSF: an introduc/on Based on version 2.2 JSF architecture The container To use JSF a bare Tomcat is not enough: you need a JSF applicaon server (e.g. Glassfish). Tomcat can be configured to run JSF: See hp://www.byteslounge.com/tutorials/ how-to-configure-jsf-in-tomcat-example The lifecycle Interac/on between the page and the beans Variables in the bean can be accessed through the Expression Language ${myObj.myVar} Accesses the myVar variable in the myObj bean It was already available in JSP JSTL Java Standard Template Library hBp://java.sun.com/products/jsp/tutorial/TagLibrariesTOC.html JSTL Core tags <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> <c:set var="foo" scope="session" value="..."/> ${foo} See http://download.oracle.com/javaee/5/tutorial/doc/bnakh.html JSTL - xml XML tags <%@ taglib uri="http://java.sun.com/jsp/jstl/xml" prefix="x" %> <c:if test="${applicationScope:booklist == null}" > <c:import url="${initParam.booksURL}" var="xml" /> <x:parse doc="${xml}" var="booklist" scope="application" /> </c:if> <x:set var="abook" select="$applicationScope.booklist/books/book[@id=$param:bookId]" /> <h2><x:out select="$abook/title"/></h2> See http://download.oracle.com/javaee/5/tutorial/doc/bnakq.html JSTL - sql SQL tags <%@ taglib uri="http://java.sun.com/jsp/jstl/sql" prefix="sql" %> <sql:setDataSource dataSource="jdbc/BookDB" /> <c:set var="bid" value="${param.Add}"/> <sql:query var="books" > select * from PUBLIC.books where id = ? <sql:param value="${bid}" /> </sql:query> See http://download.oracle.com/javaee/5/tutorial/doc/bnald.html
    [Show full text]
  • JAVA Server Faces) Con Soporte Para Clientes Heterogéneos
    Facultad de Informática - UNLP Universidad Nacional de La Plata Facultad de Informática Licenciatura en Informática Tesis de Grado Incorporando seguridad a las componentes de Interfaz de Usuario del framework JSF (JAVA Server Faces) con soporte para clientes heterogéneos. Director: Francisco Javier Díaz Codirector: Claudia Queiruga Alumno: Pablo José Iuliano Legajo: 2122/1 - 2010 - Facultad de Informática - UNLP Agradecimientos En primer lugar, quiero agradecer a Natalia, por su apoyo de incondicional tanto en la construcción de este documento como en nuestra vida juntos. Además quiero agradecer a la Lic. Claudia Queiruga y al Lic. Javier Díaz, por la certera dirección que han dado a esta tesis en cada paso del camino transitado. A mis compañeros de trabajo, Miguel Carbone, Jorge Castelluccio y Elvio Fernández, por sus aportes realizados para mejorar la producción de este documento. Finalmente quiero agradecer a mi familia por todo lo que hicieron y siguen haciendo para que mejore en todos los ámbitos de mi vida. Facultad de Informática - UNLP Índice Introducción..............................................................................................................................................1 Difusión en congresos..............................................................................................................................5 Capítulo 1 – Seguridad en JAVA............................................................................................................6 1.1 Modelos de seguridad en JAVA........................................................................................
    [Show full text]
  • Realize the Full Potential of JSF with Seam Faces and CDI What's This All About? Seam Faces Seam 3
    Brian Leathem, JBoss by Red Hat Realize the full potential of JSF with Seam Faces and CDI What's this all about? Seam Faces Seam 3 JSF 2 / CDI integration is not as thorough is it could have been. How does Seam Faces solve these problems? How are these solutions implemented in Seam Faces? Who am I? Brian Leathem • Senior Software Engineer, JBoss by Red Hat • RichFaces Core Developer • Seam Faces Module Lead • JSR 344: JavaServer Faces 2.2 The Seam Faces Emblem The Seam Faces Emblem The Seam Faces Emblem The Seam Faces Emblem The Seam Faces Emblem JSF? CDI? What? Show of hands for those in the audience who: ● are familiar with JSF? ● actively develop with JSF? ● JSF 2? ● are familiar with CDI? ● are familiar with Seam 2? JSF and CDI – Full Potential • Overview: JSF, CDI, Seam 3 • Productivity shortcuts • Dependency Injection for Everyone! • JSF/CDI Event Bridging • View Configuration • Exception Handling • Seam Faces – non visual components • JSF & CDI Scopes • Testing with Arquillian and JSFUnit Seam: Innovation, Standardization Seam 2 married JSF 1.x with EJB 3 Much of Seam 2 was standardized in JSF 2.0 and CDI But why bother? Why did the Seam project bother improving JSF, and not just write yet another Java Web framework? Why is the Seam 2 project being re-written as a set of CDI components? JSF is Great! – A lot going for it Part of the Java EE standard Many groups working to make things easier for developers. These improvements are turned back into the platform as appropriate – As we saw earlier with Seam 2 – As we saw with AJAX and JSF 1.2 The JSF Ecosystem Two JSF implementations: 1.
    [Show full text]
  • User Guide 6.1
    USER GUIDE 6.1 Author Çağatay Çivici PrimeFaces User Guide First Edition Table of Contents About the Author..................................................................................................................................9 1. Introduction....................................................................................................................................10 1.1 What is PrimeFaces?.............................................................................................................10 2. Setup...............................................................................................................................................11 2.1 Download...............................................................................................................................11 2.2 Dependencies.........................................................................................................................12 2.3 Configuration.........................................................................................................................13 2.4 Hello World...........................................................................................................................13 3. Component Suite............................................................................................................................14 3.1 AccordionPanel......................................................................................................................14 3.2 AjaxBehavior.........................................................................................................................19
    [Show full text]
  • Çağatay Çivici [email protected] Çağatay Çivici
    PRIMEFACES Çağatay Çivici [email protected] Çağatay Çivici Apache MyFaces PMC “The Definitive Guide to Apache MyFaces and Facelets” Co-Author Reference in “Core JSF 2nd Edition” (Sun Core Series) Technical reviewer of “JBoss Seam and Trinidad” and “Apache MyFaces” books Speaker in JSFOne, JSFDays, universities and local Java Groups. PrimeFaces founder and project lead Krank CRUD framework team member Trainer, Consultant, Mentor FC Barcelona fan Prime Teknoloji (UK-TURKEY) Prime Teknoloji Consulting, Training, Software Development Agile Agile Agile, TDD, Patterns Java EE, JSF, Spring, Seam, JPA www.emlakharitam.com PrimeFaces www.prime.com.tr JSF Joint Strike Fighter Crew: 1 Java Server Faces Standard WEB Framework of JAVA EE Component Oriented Event driven Swing and WEB Apache MyFaces and Sun Mojarra (RI) Vendor support (Sun, IBM, Oracle, JBoss, Apache etc) Apache MyFaces JSF 1.1 ve 1.2 implementation Tomahawk Trinidad Tobago Portlet Bridge RI Orchestra ExtVAL JSF Tools Netbeans JBoss Tools MyEclipse Eclipse WTP JDeveloper IBM RAD IDEA Macromedia Dreamweaver Component Libraries MyFaces Tomahawk MyFaces Trinidad MyFaces Tobago JBoss RichFaces IceFaces Quipukit NetAdvantage WebGalileo PrimeFaces Open Source Rich Components Easy AJAX XML Free JSF Detailed Documentation Not a framework Open Source Model May the source be with you Free :) Apache Software Foundation Experience http://code.google.com/p/primefaces/ Turkey and Open Source Turkish Support Turkish Docs (160 + sayfa) Turkish enabled components Turkish support forum PrimeFaces Modules
    [Show full text]
  • Comparison of AJAX JSF Libraries Functionality and Interoperability
    MASARYK UNIVERSITY FACULTY}w¡¢£¤¥¦§¨ OF I !"#$%&'()+,-./012345<yA|NFORMATICS Comparison of AJAX JSF Libraries Functionality and Interoperability DIPLOMA THESIS Bc. Pavol Pito ˇnák Brno, June 2011 Declaration Hereby I declare, that this paper is my original authorial work, which I have worked out by my own. All sources, references and literature used or excerpted during elaboration of this work are properly cited and listed in complete reference to the due source. Bc. Pavol Pitoˇnák Advisor: Mgr. Marek Grác ii Acknowledgement I would like to thank my supervisor, Mgr. Marek Grác, my consultant, Ing. JiˇríPechanec, and RichFaces team, especially Lukáš Fryˇc,for their guidance and support throughout my work on this thesis. Many thanks also go to my family, girlfriend, and close friends who supported me while working on this thesis. iii Abstract This thesis compares functionality of four popular JavaServer Faces component libraries— RichFaces, ICEfaces, OpenFaces, and PrimeFaces. This thesis demonstrates differences be- tween them, highlights their unique features, and research their interoperability. A demo application that would demonstrate interoperability of these libraries is created as a part of the thesis. iv Keywords Java Server Faces, JSF, RichFaces, ICEfaces, PrimeFaces, interoperability, web framework, Rich Internet Applications v Contents 1 Introduction .........................................1 2 The JavaServer Faces Framework ............................4 2.1 History of JavaServer Faces .............................4 2.2 Key Terms .......................................5 2.3 JSF Application ....................................6 2.4 The Request Processing Lifecycle ..........................8 2.5 The Navigation Model ................................ 10 2.6 Managed Beans and Scopes ............................. 12 2.7 The Facelets View Declaration Language ..................... 12 2.8 Composite Components ............................... 14 2.9 Resource Handling .................................
    [Show full text]
  • Java Technologies Lab 4
    Java Technologies Lab 4 Java Server Faces Setup ● NetBeans Maven Project - Project Properties / Frameworks / Add JSF ● pom.xml remains the same, JSF is part of Java EE specifications <artifactId>javaee-web-api</artifactId> ● web.xml ● register JSF FrontController servlet, called FacesServlet ● map the URL pattern /faces/* web.xml in a JSF Project <web-app ...> <servlet> <servlet-name>Faces Servlet</servlet-name> <servlet-class> javax.faces.webapp.FacesServlet </servlet-class> <load-on-startup>1</load-on-startup> </servlet> <servlet-mapping> <servlet-name>Faces Servlet</servlet-name> <url-pattern>/faces/*</url-pattern> </servlet-mapping> <context-param> <param-name>javax.faces.PROJECT_STAGE</param-name> <param-value>Development</param-value> </context-param> ... </web-app> Checking your setup ● Create new JSF page: index.xhtml <?xml version='1.0' encoding='UTF-8' ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xmlns:h="http://xmlns.jcp.org/jsf/html"> <h:head> <title>Facelet Title</title> </h:head> <h:body> <h:outputText value="Hello from Facelets" style="font-size: xx-large"/> </h:body> </html> ● Run: http://localhost:8080/HelloWorld/faces/index.xhtml XHTML represents "XML well-formed" HTML documents. "Rich" JSF implementations ● PrimeFaces, IceFaces, RichFaces, HighFaces, BootsFaces, etc. ● Components: "PrimeFaces is a popular open source framework for JavaServer Faces featuring over 100 components, touch optimized mobilekit,
    [Show full text]