SlideShare a Scribd company logo
1 of 41
Copyright © 2012, Oracle and/or its affiliates. All rights reserved.1
10 Tips for Java EE 7 with PrimeFaces
Mert Çalışkan & Martin Fousek
Software Architect Software Developer
at T2 Yazılım Ltd. at Oracle, NetBeans
Copyright © 2012, Oracle and/or its affiliates. All rights reserved.3
The following is intended to outline our general product direction. It is intended
for information purposes only, and may not be incorporated into any contract.
It is not a commitment to deliver any material, code, or functionality, and should
not be relied upon in making purchasing decisions. The development, release,
and timing of any features or functionality described for Oracle’s products
remains at the sole discretion of Oracle.
Copyright © 2012, Oracle and/or its affiliates. All rights reserved.4
Agenda
 Introduction
– Java EE 7 & JavaServer Faces 2.2, PrimeFaces, NetBeans IDE
 Tour through 10 features of the JSF and PF
– Feature overview
– Samples in action
Copyright © 2012, Oracle and/or its affiliates. All rights reserved.5
 Java EE 7 – 14 JSRs and 9 MRs, themes:
– HTML5
– Developer productivity
– Enterprise demands
 JavaServer Faces 2.2 big ticket features:
– HTML(5) Friendly Markup
– Faces Flow
– Resource Library Contract
Java EE 7 & JavaServer Faces 2.2
Copyright © 2012, Oracle and/or its affiliates. All rights reserved.6
 Open Source Component Library for JSF 2.x
JSF 2.2 is supported with PF version 4.x
 Very Lightweight w/ Zero Configuration
 Plenty of examples in Showcase, extensive
theming, provides mobile components
 Well documented, user guides, books & etc.
 Large and active community
PrimeFaces
Copyright © 2012, Oracle and/or its affiliates. All rights reserved.7
 Open source IDE
 Support for Java, PHP, C/C++, Groovy
 Latest features
– Java SE 7, Java EE 7 and JavaFX
– HTML(5) client side development,
CSS preprocessors, JavaSciprt frameworks
– Cordova, FindBugs, VCS improvements
– PHP 5.4 and the newest PHP frameworks
NetBeans IDE
Copyright © 2012, Oracle and/or its affiliates. All rights reserved.8
 Sample codes to demonstrate the tips
 Mavenized projects from Java EE 7 archetype
 Repository:
github.com/marfous/j1demo-pf
Sample Codes
Copyright © 2012, Oracle and/or its affiliates. All rights reserved.9
HTML(5) Friendly Markup
Copyright © 2012, Oracle and/or its affiliates. All rights reserved.10
HTML(5) Friendly Markup
 New namespaces
– passthrough elements: http://xmlns.jcp.org/jsf (TagDecorator)
– passthrough attributes: http://xmlns.jcp.org/jsf/passthrough (RenderKit)
 Advantages
– Getting control over rendered Facelets
– JSF components / JavaScript components / arbitrary mixing
– Write and style pure HTML with benefits of JSF
Copyright © 2012, Oracle and/or its affiliates. All rights reserved.11
Form with usage of HTML friendly markup: validation by
Bean Validation API with localized messages, custom Bean
Validation annotation, passthrough attributes and elements,
usage of jQuery plugin at JSF component.
01-HtmlFriendlyMarkup
https://github.com/marfous/j1demo-pf
HTML(5) Friendly Markup
Copyright © 2012, Oracle and/or its affiliates. All rights reserved.12
Resource Libraries
Contracts
Copyright © 2012, Oracle and/or its affiliates. All rights reserved.13
Resource Libraries Contracts
 Theme definitions across one or more web applications
 Libraries consisting of templates, insertion points, resources
 Can be bundled directly into Web Application or within .jar library
 How to choose the used one:
– there is only one option
– static or dynamic view definition
– URL based definition within faces-config
 Multi-templating
Copyright © 2012, Oracle and/or its affiliates. All rights reserved.14
Simple Resource Libraries Contracts usage, switching
RLCs dynamically using Expression Language and
ManagedBean.
02-ResourceLibrariesContracts
https://github.com/marfous/j1demo-pf
Resource Libraries Contracts
Copyright © 2012, Oracle and/or its affiliates. All rights reserved.15
Expression Language 3.0
Copyright © 2012, Oracle and/or its affiliates. All rights reserved.16
Expression Language 3.0
 Communication between presentation layer and application logic
 Deferred or immediate evaluation of expressions
 Sets and gets data, invokes methods
 Features
– Standalone ELProcessor
– Concatenation, semicolon and assignments operators
– Static collections
– Collection Operations (aligned with Java SE 8)
– Lambda Expressions (aligned with Java SE 8)
Copyright © 2012, Oracle and/or its affiliates. All rights reserved.17
Examples of Expression Language 3.0 features:
standalone EL Processor, operators, static fields,
collections, lambdas and collection operations.
03-ExpressionLanguage3
https://github.com/marfous/j1demo-pf
Expression Language 3.0
Copyright © 2012, Oracle and/or its affiliates. All rights reserved.18
-Prime Time with
PrimeFaces Components
Copyright © 2012, Oracle and/or its affiliates. All rights reserved.19
-Prime Time with PrimeFaces Components
 With 100+ Rich Set of Components
 Built-in Ajax based on standard JSF 2.0 Ajax APIs
 Client APIs based on
 Enterprise theming w/ Theme Roller
With 4.0 – Sentinel We’re introducing cool stuff like,
– Client Side Validation
– Dialog Framework
– Tree Drag & Drop
– Deferred Loading and many more…
Copyright © 2012, Oracle and/or its affiliates. All rights reserved.20
Examples on advanced UI components:
DataTable, Gmap, AutoComplete, Client Side
Validation, Tree Drag and Drop, The Dialog Framework
and others.
10-PrimeFacesComponents
https://github.com/marfous/j1demo-pf
-Prime Time with PrimeFaces Components
Copyright © 2012, Oracle and/or its affiliates. All rights reserved.21
In the Jungle of
PrimeFaces Themes
Copyright © 2012, Oracle and/or its affiliates. All rights reserved.22
In the Jungle of PrimeFaces Themes
 Powered w/ jQueryUI and ThemeRoller CSS Framework
Skinning and Structural CSS architecture
 ThemeRoller provides visual editor to create new themes
 ~40 themes available by only adding JAR dependency
 Advanced themes are also available
– Twitter Bootstrap Theme
– Metro UI Theme ($$)
 Configuration is done by <context-param> in web.xml
Copyright © 2012, Oracle and/or its affiliates. All rights reserved.23
Theme variations on UI Components
Configuration of theme infrastructure
04-PrimeFacesThemes
https://github.com/marfous/j1demo-pf
In the Jungle of PrimeFaces Themes
Copyright © 2012, Oracle and/or its affiliates. All rights reserved.24
PrimePush, PrimeUI and
PrimeMobile
Copyright © 2012, Oracle and/or its affiliates. All rights reserved.25
PrimePush, PrimeUI and PrimeMobile
 PrimePush brings first class support with Atmosphere Framework
– WebSockets, long polling, streaming, jsonp
 PrimeUI is spin-off from the JSF suite, provides rich javascript widgets
– autoComplete, dataTable and many others (~35 components)
 PrimeMobile offers UI components for mobile devices, supports for:
– powered by jQuery
Copyright © 2012, Oracle and/or its affiliates. All rights reserved.26
PrimePush Checkin Demo w/ PrimeMobile in Action
PrimeUI integrated with REST Services
05-PrimePushUiMobile
https://github.com/marfous/j1demo-pf
PrimePush, PrimeUI and PrimeMobile
Copyright © 2012, Oracle and/or its affiliates. All rights reserved.27
JSF scaffolding with
PrimeFaces
Copyright © 2012, Oracle and/or its affiliates. All rights reserved.28
JSF scaffolding with PrimeFaces
 Generation of CRUD skeleton from the database
– NetBeans IDE: JSPs or vanilla Facelets
– nbpfcrudgen plugin: Facelets with PrimeFaces
 Last feature – NetBeans 7.3.1 generates CDI artifacts
 Procedure
– Generate entity classes from database
– Generate JSF pages from entities
Copyright © 2012, Oracle and/or its affiliates. All rights reserved.29
CRUD application generation using standard
JavaServer Faces templates, generation of
PrimeFaces templates.
06-JsfPrimeFacesScaffolding
https://github.com/marfous/j1demo-pf
JSF scaffolding with PrimeFaces
Copyright © 2012, Oracle and/or its affiliates. All rights reserved.30
Faces Flows
Copyright © 2012, Oracle and/or its affiliates. All rights reserved.31
Faces Flows
 Reusable collection of screens with defined entry and exit points
 Nodes like switchNode, finalizer, methodCall etc.
 Derived from proven technologies: Spring WebFlow, ADF Task Flow
 JSF bound with CDI - @FlowScoped
 Definition:
– Faces-config configuration file
– Java definition using FlowBuilder (@FlowDefinition)
Copyright © 2012, Oracle and/or its affiliates. All rights reserved.32
Sample wizard using navigation elements of the Faces
Flow, flow scope defined bean, Faces Flow component
as a plugable library.
07-FacesFlow, 07-FacesFlowLibrary
https://github.com/marfous/j1demo-pf
Faces Flows
Copyright © 2012, Oracle and/or its affiliates. All rights reserved.33
Annotation based
component registration
Copyright © 2012, Oracle and/or its affiliates. All rights reserved.34
Annotation based component registration
 Improved FacesComponent interface
 Eliminates needs for the TLD file
 CDI capable component
 @FacesComponent(createTag = true,
namespace = ... , // implicitly: http://xmlns.jcp.org/jsf/component
tagName = ...) // implicitly: lowercased class name
Copyright © 2012, Oracle and/or its affiliates. All rights reserved.35
Usage of the tag defined by @FacesComponent without
any tag library, CDI binding in the component, Java SE
project as a custom tag library.
08-FacesComponent, 08-FacesComponentLibrary
https://github.com/marfous/j1demo-pf
Annotation based component registration
Copyright © 2012, Oracle and/or its affiliates. All rights reserved.36
File Upload
Copyright © 2012, Oracle and/or its affiliates. All rights reserved.37
File Upload
 Servlet 3.0 multipart architecture
 Standard component with/without AJAX requests
 For lower JSF versions already available as PrimeFaces component
 Prerequisites
– Enctype multipart/form-data of the form
– Servlet 3.0
Copyright © 2012, Oracle and/or its affiliates. All rights reserved.38
File Upload of the standard JSF 2.2 and PrimeFaces
library in action, with validation of type and size limit.
09-FileUpload
https://github.com/marfous/j1demo-pf
File Upload
Copyright © 2012, Oracle and/or its affiliates. All rights reserved.39
PrimeFaces Cookbook Over 90 practical
recipes to learn
PrimeFaces
written by:
Oleg Varaksin
& Yours Truly
Author discount 40%
with code: -
Copyright © 2012, Oracle and/or its affiliates. All rights reserved.40
Useful Links
 http://docs.oracle.com/javaee/7/tutorial/doc/home.htm
 http://www.primefaces.org/showcase
 http://blog.primefaces.org
 https://netbeans.org/kb/trails/java-ee.html
 http://sourceforge.net/projects/nbpfcrudgen
Copyright © 2012, Oracle and/or its affiliates. All rights reserved.41
Graphic Section Divider

More Related Content

What's hot

Java EE7 Demystified
Java EE7 DemystifiedJava EE7 Demystified
Java EE7 DemystifiedAnkara JUG
 
Java EE7 in action
Java EE7 in actionJava EE7 in action
Java EE7 in actionAnkara JUG
 
Java EE and Spring Side-by-Side
Java EE and Spring Side-by-SideJava EE and Spring Side-by-Side
Java EE and Spring Side-by-SideReza Rahman
 
Have You Seen Java EE Lately?
Have You Seen Java EE Lately?Have You Seen Java EE Lately?
Have You Seen Java EE Lately?Reza Rahman
 
Burns jsf-confess-2015
Burns jsf-confess-2015Burns jsf-confess-2015
Burns jsf-confess-2015Edward Burns
 
What's Coming in Java EE 8
What's Coming in Java EE 8What's Coming in Java EE 8
What's Coming in Java EE 8PT.JUG
 
Ankara JUG Ağustos 2013 - Oracle ADF
Ankara JUG Ağustos 2013 - Oracle ADFAnkara JUG Ağustos 2013 - Oracle ADF
Ankara JUG Ağustos 2013 - Oracle ADFAnkara JUG
 
Building Java Desktop Apps with JavaFX 8 and Java EE 7
Building Java Desktop Apps with JavaFX 8 and Java EE 7Building Java Desktop Apps with JavaFX 8 and Java EE 7
Building Java Desktop Apps with JavaFX 8 and Java EE 7Bruno Borges
 
Java EE 7 from an HTML5 Perspective, JavaLand 2015
Java EE 7 from an HTML5 Perspective, JavaLand 2015Java EE 7 from an HTML5 Perspective, JavaLand 2015
Java EE 7 from an HTML5 Perspective, JavaLand 2015Edward Burns
 
JavaFX and JEE 7
JavaFX and JEE 7JavaFX and JEE 7
JavaFX and JEE 7Vijay Nair
 
JavaFX 2 Using the Spring Framework
JavaFX 2 Using the Spring FrameworkJavaFX 2 Using the Spring Framework
JavaFX 2 Using the Spring FrameworkStephen Chin
 
Future of Java EE with Java SE 8
Future of Java EE with Java SE 8Future of Java EE with Java SE 8
Future of Java EE with Java SE 8Hirofumi Iwasaki
 
Spring andspringboot training
Spring andspringboot trainingSpring andspringboot training
Spring andspringboot trainingMallikarjuna G D
 
JSF 2.2 Input Output JavaLand 2015
JSF 2.2 Input Output JavaLand 2015JSF 2.2 Input Output JavaLand 2015
JSF 2.2 Input Output JavaLand 2015Edward Burns
 
Ed presents JSF 2.2 and WebSocket to Gameduell.
Ed presents JSF 2.2 and WebSocket to Gameduell.Ed presents JSF 2.2 and WebSocket to Gameduell.
Ed presents JSF 2.2 and WebSocket to Gameduell.Edward Burns
 
Introduction to Spring Framework and Spring IoC
Introduction to Spring Framework and Spring IoCIntroduction to Spring Framework and Spring IoC
Introduction to Spring Framework and Spring IoCFunnelll
 
Introduction to Ibatis by Rohit
Introduction to Ibatis by RohitIntroduction to Ibatis by Rohit
Introduction to Ibatis by RohitRohit Prabhakar
 

What's hot (20)

Java EE7 Demystified
Java EE7 DemystifiedJava EE7 Demystified
Java EE7 Demystified
 
Java EE7 in action
Java EE7 in actionJava EE7 in action
Java EE7 in action
 
JSF 2.2
JSF 2.2JSF 2.2
JSF 2.2
 
Java EE and Spring Side-by-Side
Java EE and Spring Side-by-SideJava EE and Spring Side-by-Side
Java EE and Spring Side-by-Side
 
Have You Seen Java EE Lately?
Have You Seen Java EE Lately?Have You Seen Java EE Lately?
Have You Seen Java EE Lately?
 
Burns jsf-confess-2015
Burns jsf-confess-2015Burns jsf-confess-2015
Burns jsf-confess-2015
 
What's Coming in Java EE 8
What's Coming in Java EE 8What's Coming in Java EE 8
What's Coming in Java EE 8
 
JavaFX Uni Parthenope
JavaFX Uni ParthenopeJavaFX Uni Parthenope
JavaFX Uni Parthenope
 
Ankara JUG Ağustos 2013 - Oracle ADF
Ankara JUG Ağustos 2013 - Oracle ADFAnkara JUG Ağustos 2013 - Oracle ADF
Ankara JUG Ağustos 2013 - Oracle ADF
 
Building Java Desktop Apps with JavaFX 8 and Java EE 7
Building Java Desktop Apps with JavaFX 8 and Java EE 7Building Java Desktop Apps with JavaFX 8 and Java EE 7
Building Java Desktop Apps with JavaFX 8 and Java EE 7
 
Java EE 7 from an HTML5 Perspective, JavaLand 2015
Java EE 7 from an HTML5 Perspective, JavaLand 2015Java EE 7 from an HTML5 Perspective, JavaLand 2015
Java EE 7 from an HTML5 Perspective, JavaLand 2015
 
JavaFX and JEE 7
JavaFX and JEE 7JavaFX and JEE 7
JavaFX and JEE 7
 
JavaFX 2 Using the Spring Framework
JavaFX 2 Using the Spring FrameworkJavaFX 2 Using the Spring Framework
JavaFX 2 Using the Spring Framework
 
Future of Java EE with Java SE 8
Future of Java EE with Java SE 8Future of Java EE with Java SE 8
Future of Java EE with Java SE 8
 
Spring andspringboot training
Spring andspringboot trainingSpring andspringboot training
Spring andspringboot training
 
JSF 2.2 Input Output JavaLand 2015
JSF 2.2 Input Output JavaLand 2015JSF 2.2 Input Output JavaLand 2015
JSF 2.2 Input Output JavaLand 2015
 
Move from J2EE to Java EE
Move from J2EE to Java EEMove from J2EE to Java EE
Move from J2EE to Java EE
 
Ed presents JSF 2.2 and WebSocket to Gameduell.
Ed presents JSF 2.2 and WebSocket to Gameduell.Ed presents JSF 2.2 and WebSocket to Gameduell.
Ed presents JSF 2.2 and WebSocket to Gameduell.
 
Introduction to Spring Framework and Spring IoC
Introduction to Spring Framework and Spring IoCIntroduction to Spring Framework and Spring IoC
Introduction to Spring Framework and Spring IoC
 
Introduction to Ibatis by Rohit
Introduction to Ibatis by RohitIntroduction to Ibatis by Rohit
Introduction to Ibatis by Rohit
 

Similar to 10 Tips for Java EE 7 with PrimeFaces

10 Tips for Java EE 7 with PrimeFaces - JavaOne 2013
10 Tips for Java EE 7 with PrimeFaces - JavaOne 201310 Tips for Java EE 7 with PrimeFaces - JavaOne 2013
10 Tips for Java EE 7 with PrimeFaces - JavaOne 2013Martin Fousek
 
55 New Features in Java SE 8
55 New Features in Java SE 855 New Features in Java SE 8
55 New Features in Java SE 8Simon Ritter
 
GlassFish in Production Environments
GlassFish in Production EnvironmentsGlassFish in Production Environments
GlassFish in Production EnvironmentsBruno Borges
 
How Scala, Wicket, and Java EE Can Improve Web Development
How Scala, Wicket, and Java EE Can Improve Web DevelopmentHow Scala, Wicket, and Java EE Can Improve Web Development
How Scala, Wicket, and Java EE Can Improve Web DevelopmentBruno Borges
 
What's new for JavaFX in JDK8 - Weaver
What's new for JavaFX in JDK8 - WeaverWhat's new for JavaFX in JDK8 - Weaver
What's new for JavaFX in JDK8 - WeaverCodemotion
 
Java EE 7 - Embracing the Cloud and HTML 5
Java EE 7 - Embracing the Cloud and HTML 5Java EE 7 - Embracing the Cloud and HTML 5
Java EE 7 - Embracing the Cloud and HTML 5Amit Naik
 
Whats Next for JCA?
Whats Next for JCA?Whats Next for JCA?
Whats Next for JCA?Fred Rowe
 
Consuming Java EE in Desktop, Web, and Mobile Frontends
Consuming Java EE in Desktop, Web, and Mobile FrontendsConsuming Java EE in Desktop, Web, and Mobile Frontends
Consuming Java EE in Desktop, Web, and Mobile FrontendsGeertjan Wielenga
 
Building Large Java Projects Faster: Multicore javac and Makefile integration
Building Large Java Projects Faster: Multicore javac and Makefile integrationBuilding Large Java Projects Faster: Multicore javac and Makefile integration
Building Large Java Projects Faster: Multicore javac and Makefile integrationFredrik Öhrström
 
Project Lambda: Functional Programming Constructs in Java - Simon Ritter (Ora...
Project Lambda: Functional Programming Constructs in Java - Simon Ritter (Ora...Project Lambda: Functional Programming Constructs in Java - Simon Ritter (Ora...
Project Lambda: Functional Programming Constructs in Java - Simon Ritter (Ora...jaxLondonConference
 
Building microservice for api with helidon and cicd pipeline
Building microservice for api with helidon and cicd pipelineBuilding microservice for api with helidon and cicd pipeline
Building microservice for api with helidon and cicd pipelineDonghuKIM2
 
Introduction Java Web Framework and Web Server.
Introduction Java Web Framework and Web Server.Introduction Java Web Framework and Web Server.
Introduction Java Web Framework and Web Server.suranisaunak
 
GlassFish BOF
GlassFish BOFGlassFish BOF
GlassFish BOFglassfish
 

Similar to 10 Tips for Java EE 7 with PrimeFaces (20)

10 Tips for Java EE 7 with PrimeFaces - JavaOne 2013
10 Tips for Java EE 7 with PrimeFaces - JavaOne 201310 Tips for Java EE 7 with PrimeFaces - JavaOne 2013
10 Tips for Java EE 7 with PrimeFaces - JavaOne 2013
 
55 New Features in Java SE 8
55 New Features in Java SE 855 New Features in Java SE 8
55 New Features in Java SE 8
 
GlassFish in Production Environments
GlassFish in Production EnvironmentsGlassFish in Production Environments
GlassFish in Production Environments
 
How Scala, Wicket, and Java EE Can Improve Web Development
How Scala, Wicket, and Java EE Can Improve Web DevelopmentHow Scala, Wicket, and Java EE Can Improve Web Development
How Scala, Wicket, and Java EE Can Improve Web Development
 
JDK 10 Java Module System
JDK 10 Java Module SystemJDK 10 Java Module System
JDK 10 Java Module System
 
What's new for JavaFX in JDK8 - Weaver
What's new for JavaFX in JDK8 - WeaverWhat's new for JavaFX in JDK8 - Weaver
What's new for JavaFX in JDK8 - Weaver
 
Java SE 8
Java SE 8Java SE 8
Java SE 8
 
Java EE 7 - Embracing the Cloud and HTML 5
Java EE 7 - Embracing the Cloud and HTML 5Java EE 7 - Embracing the Cloud and HTML 5
Java EE 7 - Embracing the Cloud and HTML 5
 
Whats Next for JCA?
Whats Next for JCA?Whats Next for JCA?
Whats Next for JCA?
 
Marcin Szałowicz - MySQL Workbench
Marcin Szałowicz - MySQL WorkbenchMarcin Szałowicz - MySQL Workbench
Marcin Szałowicz - MySQL Workbench
 
Java ee7 1hour
Java ee7 1hourJava ee7 1hour
Java ee7 1hour
 
JavaCro'14 - Consuming Java EE Backends in Desktop, Web, and Mobile Frontends...
JavaCro'14 - Consuming Java EE Backends in Desktop, Web, and Mobile Frontends...JavaCro'14 - Consuming Java EE Backends in Desktop, Web, and Mobile Frontends...
JavaCro'14 - Consuming Java EE Backends in Desktop, Web, and Mobile Frontends...
 
Consuming Java EE in Desktop, Web, and Mobile Frontends
Consuming Java EE in Desktop, Web, and Mobile FrontendsConsuming Java EE in Desktop, Web, and Mobile Frontends
Consuming Java EE in Desktop, Web, and Mobile Frontends
 
Building Large Java Projects Faster: Multicore javac and Makefile integration
Building Large Java Projects Faster: Multicore javac and Makefile integrationBuilding Large Java Projects Faster: Multicore javac and Makefile integration
Building Large Java Projects Faster: Multicore javac and Makefile integration
 
Project Lambda: Functional Programming Constructs in Java - Simon Ritter (Ora...
Project Lambda: Functional Programming Constructs in Java - Simon Ritter (Ora...Project Lambda: Functional Programming Constructs in Java - Simon Ritter (Ora...
Project Lambda: Functional Programming Constructs in Java - Simon Ritter (Ora...
 
Ramji
RamjiRamji
Ramji
 
Java Cloud and Container Ready
Java Cloud and Container ReadyJava Cloud and Container Ready
Java Cloud and Container Ready
 
Building microservice for api with helidon and cicd pipeline
Building microservice for api with helidon and cicd pipelineBuilding microservice for api with helidon and cicd pipeline
Building microservice for api with helidon and cicd pipeline
 
Introduction Java Web Framework and Web Server.
Introduction Java Web Framework and Web Server.Introduction Java Web Framework and Web Server.
Introduction Java Web Framework and Web Server.
 
GlassFish BOF
GlassFish BOFGlassFish BOF
GlassFish BOF
 

More from Mert Çalışkan

BMO - Intelligent Projects with Maven
BMO - Intelligent Projects with MavenBMO - Intelligent Projects with Maven
BMO - Intelligent Projects with MavenMert Çalışkan
 
Intelligent Projects with Maven - DevFest Istanbul
Intelligent Projects with Maven - DevFest IstanbulIntelligent Projects with Maven - DevFest Istanbul
Intelligent Projects with Maven - DevFest IstanbulMert Çalışkan
 
Gelecex - Maven ile Akilli Projeler
Gelecex - Maven ile Akilli ProjelerGelecex - Maven ile Akilli Projeler
Gelecex - Maven ile Akilli ProjelerMert Çalışkan
 
Enterprise Java Web Application Frameworks Sample Stack Implementation
Enterprise Java Web Application Frameworks   Sample Stack ImplementationEnterprise Java Web Application Frameworks   Sample Stack Implementation
Enterprise Java Web Application Frameworks Sample Stack ImplementationMert Çalışkan
 

More from Mert Çalışkan (7)

BMO - Intelligent Projects with Maven
BMO - Intelligent Projects with MavenBMO - Intelligent Projects with Maven
BMO - Intelligent Projects with Maven
 
Intelligent Projects with Maven - DevFest Istanbul
Intelligent Projects with Maven - DevFest IstanbulIntelligent Projects with Maven - DevFest Istanbul
Intelligent Projects with Maven - DevFest Istanbul
 
Better Career with Java
Better Career with JavaBetter Career with Java
Better Career with Java
 
Test Infected
Test InfectedTest Infected
Test Infected
 
Gelecex - Maven ile Akilli Projeler
Gelecex - Maven ile Akilli ProjelerGelecex - Maven ile Akilli Projeler
Gelecex - Maven ile Akilli Projeler
 
Fikrim Acik Kodum Acik
Fikrim Acik Kodum AcikFikrim Acik Kodum Acik
Fikrim Acik Kodum Acik
 
Enterprise Java Web Application Frameworks Sample Stack Implementation
Enterprise Java Web Application Frameworks   Sample Stack ImplementationEnterprise Java Web Application Frameworks   Sample Stack Implementation
Enterprise Java Web Application Frameworks Sample Stack Implementation
 

Recently uploaded

Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17Celine George
 
Final demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptxFinal demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptxAvyJaneVismanos
 
Presiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsPresiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsanshu789521
 
Gas measurement O2,Co2,& ph) 04/2024.pptx
Gas measurement O2,Co2,& ph) 04/2024.pptxGas measurement O2,Co2,& ph) 04/2024.pptx
Gas measurement O2,Co2,& ph) 04/2024.pptxDr.Ibrahim Hassaan
 
MARGINALIZATION (Different learners in Marginalized Group
MARGINALIZATION (Different learners in Marginalized GroupMARGINALIZATION (Different learners in Marginalized Group
MARGINALIZATION (Different learners in Marginalized GroupJonathanParaisoCruz
 
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdfFraming an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdfUjwalaBharambe
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Educationpboyjonauth
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxSayali Powar
 
MICROBIOLOGY biochemical test detailed.pptx
MICROBIOLOGY biochemical test detailed.pptxMICROBIOLOGY biochemical test detailed.pptx
MICROBIOLOGY biochemical test detailed.pptxabhijeetpadhi001
 
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdfssuser54595a
 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptxVS Mahajan Coaching Centre
 
Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Celine George
 
Pharmacognosy Flower 3. Compositae 2023.pdf
Pharmacognosy Flower 3. Compositae 2023.pdfPharmacognosy Flower 3. Compositae 2023.pdf
Pharmacognosy Flower 3. Compositae 2023.pdfMahmoud M. Sallam
 
DATA STRUCTURE AND ALGORITHM for beginners
DATA STRUCTURE AND ALGORITHM for beginnersDATA STRUCTURE AND ALGORITHM for beginners
DATA STRUCTURE AND ALGORITHM for beginnersSabitha Banu
 
Painted Grey Ware.pptx, PGW Culture of India
Painted Grey Ware.pptx, PGW Culture of IndiaPainted Grey Ware.pptx, PGW Culture of India
Painted Grey Ware.pptx, PGW Culture of IndiaVirag Sontakke
 
What is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERPWhat is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERPCeline George
 
Procuring digital preservation CAN be quick and painless with our new dynamic...
Procuring digital preservation CAN be quick and painless with our new dynamic...Procuring digital preservation CAN be quick and painless with our new dynamic...
Procuring digital preservation CAN be quick and painless with our new dynamic...Jisc
 
CELL CYCLE Division Science 8 quarter IV.pptx
CELL CYCLE Division Science 8 quarter IV.pptxCELL CYCLE Division Science 8 quarter IV.pptx
CELL CYCLE Division Science 8 quarter IV.pptxJiesonDelaCerna
 

Recently uploaded (20)

Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17
 
Final demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptxFinal demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptx
 
Presiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsPresiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha elections
 
Gas measurement O2,Co2,& ph) 04/2024.pptx
Gas measurement O2,Co2,& ph) 04/2024.pptxGas measurement O2,Co2,& ph) 04/2024.pptx
Gas measurement O2,Co2,& ph) 04/2024.pptx
 
MARGINALIZATION (Different learners in Marginalized Group
MARGINALIZATION (Different learners in Marginalized GroupMARGINALIZATION (Different learners in Marginalized Group
MARGINALIZATION (Different learners in Marginalized Group
 
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdfFraming an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
 
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdfTataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Education
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
 
MICROBIOLOGY biochemical test detailed.pptx
MICROBIOLOGY biochemical test detailed.pptxMICROBIOLOGY biochemical test detailed.pptx
MICROBIOLOGY biochemical test detailed.pptx
 
ESSENTIAL of (CS/IT/IS) class 06 (database)
ESSENTIAL of (CS/IT/IS) class 06 (database)ESSENTIAL of (CS/IT/IS) class 06 (database)
ESSENTIAL of (CS/IT/IS) class 06 (database)
 
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
 
Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17
 
Pharmacognosy Flower 3. Compositae 2023.pdf
Pharmacognosy Flower 3. Compositae 2023.pdfPharmacognosy Flower 3. Compositae 2023.pdf
Pharmacognosy Flower 3. Compositae 2023.pdf
 
DATA STRUCTURE AND ALGORITHM for beginners
DATA STRUCTURE AND ALGORITHM for beginnersDATA STRUCTURE AND ALGORITHM for beginners
DATA STRUCTURE AND ALGORITHM for beginners
 
Painted Grey Ware.pptx, PGW Culture of India
Painted Grey Ware.pptx, PGW Culture of IndiaPainted Grey Ware.pptx, PGW Culture of India
Painted Grey Ware.pptx, PGW Culture of India
 
What is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERPWhat is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERP
 
Procuring digital preservation CAN be quick and painless with our new dynamic...
Procuring digital preservation CAN be quick and painless with our new dynamic...Procuring digital preservation CAN be quick and painless with our new dynamic...
Procuring digital preservation CAN be quick and painless with our new dynamic...
 
CELL CYCLE Division Science 8 quarter IV.pptx
CELL CYCLE Division Science 8 quarter IV.pptxCELL CYCLE Division Science 8 quarter IV.pptx
CELL CYCLE Division Science 8 quarter IV.pptx
 

10 Tips for Java EE 7 with PrimeFaces

  • 1. Copyright © 2012, Oracle and/or its affiliates. All rights reserved.1
  • 2. 10 Tips for Java EE 7 with PrimeFaces Mert Çalışkan & Martin Fousek Software Architect Software Developer at T2 Yazılım Ltd. at Oracle, NetBeans
  • 3. Copyright © 2012, Oracle and/or its affiliates. All rights reserved.3 The following is intended to outline our general product direction. It is intended for information purposes only, and may not be incorporated into any contract. It is not a commitment to deliver any material, code, or functionality, and should not be relied upon in making purchasing decisions. The development, release, and timing of any features or functionality described for Oracle’s products remains at the sole discretion of Oracle.
  • 4. Copyright © 2012, Oracle and/or its affiliates. All rights reserved.4 Agenda  Introduction – Java EE 7 & JavaServer Faces 2.2, PrimeFaces, NetBeans IDE  Tour through 10 features of the JSF and PF – Feature overview – Samples in action
  • 5. Copyright © 2012, Oracle and/or its affiliates. All rights reserved.5  Java EE 7 – 14 JSRs and 9 MRs, themes: – HTML5 – Developer productivity – Enterprise demands  JavaServer Faces 2.2 big ticket features: – HTML(5) Friendly Markup – Faces Flow – Resource Library Contract Java EE 7 & JavaServer Faces 2.2
  • 6. Copyright © 2012, Oracle and/or its affiliates. All rights reserved.6  Open Source Component Library for JSF 2.x JSF 2.2 is supported with PF version 4.x  Very Lightweight w/ Zero Configuration  Plenty of examples in Showcase, extensive theming, provides mobile components  Well documented, user guides, books & etc.  Large and active community PrimeFaces
  • 7. Copyright © 2012, Oracle and/or its affiliates. All rights reserved.7  Open source IDE  Support for Java, PHP, C/C++, Groovy  Latest features – Java SE 7, Java EE 7 and JavaFX – HTML(5) client side development, CSS preprocessors, JavaSciprt frameworks – Cordova, FindBugs, VCS improvements – PHP 5.4 and the newest PHP frameworks NetBeans IDE
  • 8. Copyright © 2012, Oracle and/or its affiliates. All rights reserved.8  Sample codes to demonstrate the tips  Mavenized projects from Java EE 7 archetype  Repository: github.com/marfous/j1demo-pf Sample Codes
  • 9. Copyright © 2012, Oracle and/or its affiliates. All rights reserved.9 HTML(5) Friendly Markup
  • 10. Copyright © 2012, Oracle and/or its affiliates. All rights reserved.10 HTML(5) Friendly Markup  New namespaces – passthrough elements: http://xmlns.jcp.org/jsf (TagDecorator) – passthrough attributes: http://xmlns.jcp.org/jsf/passthrough (RenderKit)  Advantages – Getting control over rendered Facelets – JSF components / JavaScript components / arbitrary mixing – Write and style pure HTML with benefits of JSF
  • 11. Copyright © 2012, Oracle and/or its affiliates. All rights reserved.11 Form with usage of HTML friendly markup: validation by Bean Validation API with localized messages, custom Bean Validation annotation, passthrough attributes and elements, usage of jQuery plugin at JSF component. 01-HtmlFriendlyMarkup https://github.com/marfous/j1demo-pf HTML(5) Friendly Markup
  • 12. Copyright © 2012, Oracle and/or its affiliates. All rights reserved.12 Resource Libraries Contracts
  • 13. Copyright © 2012, Oracle and/or its affiliates. All rights reserved.13 Resource Libraries Contracts  Theme definitions across one or more web applications  Libraries consisting of templates, insertion points, resources  Can be bundled directly into Web Application or within .jar library  How to choose the used one: – there is only one option – static or dynamic view definition – URL based definition within faces-config  Multi-templating
  • 14. Copyright © 2012, Oracle and/or its affiliates. All rights reserved.14 Simple Resource Libraries Contracts usage, switching RLCs dynamically using Expression Language and ManagedBean. 02-ResourceLibrariesContracts https://github.com/marfous/j1demo-pf Resource Libraries Contracts
  • 15. Copyright © 2012, Oracle and/or its affiliates. All rights reserved.15 Expression Language 3.0
  • 16. Copyright © 2012, Oracle and/or its affiliates. All rights reserved.16 Expression Language 3.0  Communication between presentation layer and application logic  Deferred or immediate evaluation of expressions  Sets and gets data, invokes methods  Features – Standalone ELProcessor – Concatenation, semicolon and assignments operators – Static collections – Collection Operations (aligned with Java SE 8) – Lambda Expressions (aligned with Java SE 8)
  • 17. Copyright © 2012, Oracle and/or its affiliates. All rights reserved.17 Examples of Expression Language 3.0 features: standalone EL Processor, operators, static fields, collections, lambdas and collection operations. 03-ExpressionLanguage3 https://github.com/marfous/j1demo-pf Expression Language 3.0
  • 18. Copyright © 2012, Oracle and/or its affiliates. All rights reserved.18 -Prime Time with PrimeFaces Components
  • 19. Copyright © 2012, Oracle and/or its affiliates. All rights reserved.19 -Prime Time with PrimeFaces Components  With 100+ Rich Set of Components  Built-in Ajax based on standard JSF 2.0 Ajax APIs  Client APIs based on  Enterprise theming w/ Theme Roller With 4.0 – Sentinel We’re introducing cool stuff like, – Client Side Validation – Dialog Framework – Tree Drag & Drop – Deferred Loading and many more…
  • 20. Copyright © 2012, Oracle and/or its affiliates. All rights reserved.20 Examples on advanced UI components: DataTable, Gmap, AutoComplete, Client Side Validation, Tree Drag and Drop, The Dialog Framework and others. 10-PrimeFacesComponents https://github.com/marfous/j1demo-pf -Prime Time with PrimeFaces Components
  • 21. Copyright © 2012, Oracle and/or its affiliates. All rights reserved.21 In the Jungle of PrimeFaces Themes
  • 22. Copyright © 2012, Oracle and/or its affiliates. All rights reserved.22 In the Jungle of PrimeFaces Themes  Powered w/ jQueryUI and ThemeRoller CSS Framework Skinning and Structural CSS architecture  ThemeRoller provides visual editor to create new themes  ~40 themes available by only adding JAR dependency  Advanced themes are also available – Twitter Bootstrap Theme – Metro UI Theme ($$)  Configuration is done by <context-param> in web.xml
  • 23. Copyright © 2012, Oracle and/or its affiliates. All rights reserved.23 Theme variations on UI Components Configuration of theme infrastructure 04-PrimeFacesThemes https://github.com/marfous/j1demo-pf In the Jungle of PrimeFaces Themes
  • 24. Copyright © 2012, Oracle and/or its affiliates. All rights reserved.24 PrimePush, PrimeUI and PrimeMobile
  • 25. Copyright © 2012, Oracle and/or its affiliates. All rights reserved.25 PrimePush, PrimeUI and PrimeMobile  PrimePush brings first class support with Atmosphere Framework – WebSockets, long polling, streaming, jsonp  PrimeUI is spin-off from the JSF suite, provides rich javascript widgets – autoComplete, dataTable and many others (~35 components)  PrimeMobile offers UI components for mobile devices, supports for: – powered by jQuery
  • 26. Copyright © 2012, Oracle and/or its affiliates. All rights reserved.26 PrimePush Checkin Demo w/ PrimeMobile in Action PrimeUI integrated with REST Services 05-PrimePushUiMobile https://github.com/marfous/j1demo-pf PrimePush, PrimeUI and PrimeMobile
  • 27. Copyright © 2012, Oracle and/or its affiliates. All rights reserved.27 JSF scaffolding with PrimeFaces
  • 28. Copyright © 2012, Oracle and/or its affiliates. All rights reserved.28 JSF scaffolding with PrimeFaces  Generation of CRUD skeleton from the database – NetBeans IDE: JSPs or vanilla Facelets – nbpfcrudgen plugin: Facelets with PrimeFaces  Last feature – NetBeans 7.3.1 generates CDI artifacts  Procedure – Generate entity classes from database – Generate JSF pages from entities
  • 29. Copyright © 2012, Oracle and/or its affiliates. All rights reserved.29 CRUD application generation using standard JavaServer Faces templates, generation of PrimeFaces templates. 06-JsfPrimeFacesScaffolding https://github.com/marfous/j1demo-pf JSF scaffolding with PrimeFaces
  • 30. Copyright © 2012, Oracle and/or its affiliates. All rights reserved.30 Faces Flows
  • 31. Copyright © 2012, Oracle and/or its affiliates. All rights reserved.31 Faces Flows  Reusable collection of screens with defined entry and exit points  Nodes like switchNode, finalizer, methodCall etc.  Derived from proven technologies: Spring WebFlow, ADF Task Flow  JSF bound with CDI - @FlowScoped  Definition: – Faces-config configuration file – Java definition using FlowBuilder (@FlowDefinition)
  • 32. Copyright © 2012, Oracle and/or its affiliates. All rights reserved.32 Sample wizard using navigation elements of the Faces Flow, flow scope defined bean, Faces Flow component as a plugable library. 07-FacesFlow, 07-FacesFlowLibrary https://github.com/marfous/j1demo-pf Faces Flows
  • 33. Copyright © 2012, Oracle and/or its affiliates. All rights reserved.33 Annotation based component registration
  • 34. Copyright © 2012, Oracle and/or its affiliates. All rights reserved.34 Annotation based component registration  Improved FacesComponent interface  Eliminates needs for the TLD file  CDI capable component  @FacesComponent(createTag = true, namespace = ... , // implicitly: http://xmlns.jcp.org/jsf/component tagName = ...) // implicitly: lowercased class name
  • 35. Copyright © 2012, Oracle and/or its affiliates. All rights reserved.35 Usage of the tag defined by @FacesComponent without any tag library, CDI binding in the component, Java SE project as a custom tag library. 08-FacesComponent, 08-FacesComponentLibrary https://github.com/marfous/j1demo-pf Annotation based component registration
  • 36. Copyright © 2012, Oracle and/or its affiliates. All rights reserved.36 File Upload
  • 37. Copyright © 2012, Oracle and/or its affiliates. All rights reserved.37 File Upload  Servlet 3.0 multipart architecture  Standard component with/without AJAX requests  For lower JSF versions already available as PrimeFaces component  Prerequisites – Enctype multipart/form-data of the form – Servlet 3.0
  • 38. Copyright © 2012, Oracle and/or its affiliates. All rights reserved.38 File Upload of the standard JSF 2.2 and PrimeFaces library in action, with validation of type and size limit. 09-FileUpload https://github.com/marfous/j1demo-pf File Upload
  • 39. Copyright © 2012, Oracle and/or its affiliates. All rights reserved.39 PrimeFaces Cookbook Over 90 practical recipes to learn PrimeFaces written by: Oleg Varaksin & Yours Truly Author discount 40% with code: -
  • 40. Copyright © 2012, Oracle and/or its affiliates. All rights reserved.40 Useful Links  http://docs.oracle.com/javaee/7/tutorial/doc/home.htm  http://www.primefaces.org/showcase  http://blog.primefaces.org  https://netbeans.org/kb/trails/java-ee.html  http://sourceforge.net/projects/nbpfcrudgen
  • 41. Copyright © 2012, Oracle and/or its affiliates. All rights reserved.41 Graphic Section Divider