SlideShare une entreprise Scribd logo
1  sur  28
Télécharger pour lire hors ligne
Utilizing JSF
Front Ends w Microservices
Code Smarter
Josh Juneau

Apress and Java Magazine Author

JCP Member, Apache NetBeans Contributor,

Java Champion, Jakarta EE Ambassadors
About Me
• Developer, DBA, System Administrator
• Author, Speaker, Podcaster
• Java Champion
• Apache NetBeans Developer
• Jakarta EE Ambassadors
Agenda
• Primer on newer features of Jakarta Server
Faces and Jakarta RESTful Web Services
• Simple services utilizing Jakarta EE
specifications.
• Basic Jakarta Server Faces front end to
display and update data via RESTful web
services.
• Incorporation of JSF frameworks to build
robust front ends.
How to Get Started
Today
• Download Eclipse GlassFish 5.1.0 (Utilize Payara
5.194+ for JDK 11 support)
• https://projects.eclipse.org/projects/
ee4j.glassfish
• Include Jakarta EE 8 dependencies into your
project
• Great examples:
• https://github.com/juneau001/JakartaEE-Playground
• https://projects.eclipse.org/projects/ee4j.jakartaee-platform/
Jakarta EE 8 Overview
• Continued enhancements for productivity
and web standards alignment
• Better alignment with Java SE 8
• Work towards a better platform for
development of microservices
Jakarta Server Faces
• Enhanced CDI
Alignment
• WebSocket
Integration
• Ajax Method
Invocation
• Class LevelValidation
• Java 8 Date-Time
• Iterable/Map/Custom
UIData Support
• Component Search
Expressions
• Radio Button
• styleclass on h:column
• Basic Support for
Extensionless URLs
New Features with 2.3
Utilize Date-Time API
Make use of the <f:convertDateTime /> tag.
New type attribute values on
<f:convertDateTime>:
• localDate, localTime, localDateTime
• offsetTime,offsetDateTime,
zonedDateTime
Jakarta Server Faces 3.0
• Removal of old cruft
• JSF’s own expression language
• Managed Beans
• Move more artifacts towards CDI
• Action Model (Not to compete with Krazo)
• Extensionless Mapping
Resource Injection
Inject JSF artifacts in JSF 2.3, and even
possible to inject into other JSF artifacts.
@Inject
private ExternalContext externalContext;
@Inject
private ServletContext servletContext;
How it Works
JSF 2.3 provides default producers for
many of the most commonly used JSF
artifacts, therefore, we can now inject
rather than hard-code.
Converters, validators and behaviors are
now also injection targets.
How it Works
Jakarta API for RESTful
Web Services
• Improved CDI Integration
• Reactive Client API
• Non-Blocking I/O
• https://github.com/jax-rs/spec
• Server Sent Events
• One way communication channel
• Text protocol,“text/event-stream” media
type
• Multiple messages
• Retry interval
Jakarta API for RESTful
Web Services
Building a Simple
Service
• JAX-RS
• JPA
• BeanValidation
Using JSF for Front End
• Model: Model Classes
• View: Facelets
• Controller: CDI Beans
• Wire together with Expression Language
Front End Service
• Utilize JAX-RS (RESTful Web Services) client
• All database work occurs within the
microservice (JPA, EJB if needed)
• Utilize JAX-RS to provide data to client
JAX-RS Client
Client client = ClientBuilder.newClient();
WebTarget resource = client.target(clientUri).path(clientService);
List<Roster> rosterList =
resource.request(javax.ws.rs.core.MediaType.APPLICATION_XML)
.get(new GenericType<List<Roster>>() {
})
RESTful Service
@GET
@Override
@Produces({MediaType.APPLICATION_XML,
MediaType.APPLICATION_JSON})
public List<Roster> findAll() {
return super.findAll();
}
Communicate (Demo)
• Basic communication to display database
table data
Writing or Modifying
Data
• Utilize @PUT and @POST
Writing or Modifying
Data
Writing or Modifying
Data
Writing or Modifying
Data
• Demo Utilizing JAX-RS forms and responses
Invoking Underlying
Database Service
• @NamedStoredProcedure
SecureYour Services!
• Recommend using OAUTH or LDAP
authentication, generating token
• Utilize JWT to secure endpoints
• MicroProfile JWT
Dozens of Libraries
• PrimeFaces
• ButterFaces
• MyFaces
• OmniFaces (Utilities)
Summary
• Utilize microservices with JPA and JAX-RS
to build database communication
• Create front-ends using JSF, CDI, JAX-RS
• Utilize third party libraries for limitless
options
Learn More

Contenu connexe

Tendances

Successfully Implementing DEV-SEC-OPS in the Cloud
Successfully Implementing DEV-SEC-OPS in the CloudSuccessfully Implementing DEV-SEC-OPS in the Cloud
Successfully Implementing DEV-SEC-OPS in the Cloud
Amazon Web Services
 
Best Practices NgRx for Scaling Your Angular Application
Best Practices NgRx  for Scaling Your Angular ApplicationBest Practices NgRx  for Scaling Your Angular Application
Best Practices NgRx for Scaling Your Angular Application
Vagner Oliveira
 

Tendances (20)

Resilience4j with Spring Boot
Resilience4j with Spring BootResilience4j with Spring Boot
Resilience4j with Spring Boot
 
Architecture: Microservices
Architecture: MicroservicesArchitecture: Microservices
Architecture: Microservices
 
Introduction to Microservices
Introduction to MicroservicesIntroduction to Microservices
Introduction to Microservices
 
Micro services Architecture
Micro services ArchitectureMicro services Architecture
Micro services Architecture
 
Successfully Implementing DEV-SEC-OPS in the Cloud
Successfully Implementing DEV-SEC-OPS in the CloudSuccessfully Implementing DEV-SEC-OPS in the Cloud
Successfully Implementing DEV-SEC-OPS in the Cloud
 
A Hands-On Introduction To Docker Containers.pdf
A Hands-On Introduction To Docker Containers.pdfA Hands-On Introduction To Docker Containers.pdf
A Hands-On Introduction To Docker Containers.pdf
 
Microservices
Microservices Microservices
Microservices
 
How to Get Started with DevSecOps
How to Get Started with DevSecOpsHow to Get Started with DevSecOps
How to Get Started with DevSecOps
 
Microservice vs. Monolithic Architecture
Microservice vs. Monolithic ArchitectureMicroservice vs. Monolithic Architecture
Microservice vs. Monolithic Architecture
 
Hexagonal architecture for java applications
Hexagonal architecture for java applicationsHexagonal architecture for java applications
Hexagonal architecture for java applications
 
Clean Architecture
Clean ArchitectureClean Architecture
Clean Architecture
 
Springboot Microservices
Springboot MicroservicesSpringboot Microservices
Springboot Microservices
 
2012 the clean architecture by Uncle bob
2012 the clean architecture by Uncle bob 2012 the clean architecture by Uncle bob
2012 the clean architecture by Uncle bob
 
REST APIs with Spring
REST APIs with SpringREST APIs with Spring
REST APIs with Spring
 
Flutter tutorial for Beginner Step by Step
Flutter tutorial for Beginner Step by StepFlutter tutorial for Beginner Step by Step
Flutter tutorial for Beginner Step by Step
 
Microservices Architecture - Bangkok 2018
Microservices Architecture - Bangkok 2018Microservices Architecture - Bangkok 2018
Microservices Architecture - Bangkok 2018
 
DevOps Introduction
DevOps IntroductionDevOps Introduction
DevOps Introduction
 
Jenkins
JenkinsJenkins
Jenkins
 
Best Practices NgRx for Scaling Your Angular Application
Best Practices NgRx  for Scaling Your Angular ApplicationBest Practices NgRx  for Scaling Your Angular Application
Best Practices NgRx for Scaling Your Angular Application
 
Clean architecture
Clean architectureClean architecture
Clean architecture
 

Similaire à Utilizing JSF Front Ends with Microservices

Java EE 6, Eclipse @ EclipseCon
Java EE 6, Eclipse @ EclipseConJava EE 6, Eclipse @ EclipseCon
Java EE 6, Eclipse @ EclipseCon
Ludovic Champenois
 
Lecture 19 dynamic web - java - part 1
Lecture 19   dynamic web - java - part 1Lecture 19   dynamic web - java - part 1
Lecture 19 dynamic web - java - part 1
Д. Ганаа
 
Lecture 19 - Dynamic Web - JAVA - Part 1.ppt
Lecture 19 - Dynamic Web - JAVA - Part 1.pptLecture 19 - Dynamic Web - JAVA - Part 1.ppt
Lecture 19 - Dynamic Web - JAVA - Part 1.ppt
KalsoomTahir2
 

Similaire à Utilizing JSF Front Ends with Microservices (20)

Migrating to Jakarta EE 10
Migrating to Jakarta EE 10Migrating to Jakarta EE 10
Migrating to Jakarta EE 10
 
Java EE8 - by Kito Mann
Java EE8 - by Kito Mann Java EE8 - by Kito Mann
Java EE8 - by Kito Mann
 
4. J2EE.pptx
4. J2EE.pptx4. J2EE.pptx
4. J2EE.pptx
 
Overview of Java EE 6 by Roberto Chinnici at SFJUG
Overview of Java EE 6 by Roberto Chinnici at SFJUGOverview of Java EE 6 by Roberto Chinnici at SFJUG
Overview of Java EE 6 by Roberto Chinnici at SFJUG
 
Java EE 6, Eclipse @ EclipseCon
Java EE 6, Eclipse @ EclipseConJava EE 6, Eclipse @ EclipseCon
Java EE 6, Eclipse @ EclipseCon
 
Resume
ResumeResume
Resume
 
What’s new in Java SE, EE, ME, Embedded world & new Strategy
What’s new in Java SE, EE, ME, Embedded world & new StrategyWhat’s new in Java SE, EE, ME, Embedded world & new Strategy
What’s new in Java SE, EE, ME, Embedded world & new Strategy
 
AAI-1713 Introduction to Java EE 7
AAI-1713 Introduction to Java EE 7AAI-1713 Introduction to Java EE 7
AAI-1713 Introduction to Java EE 7
 
AAI 1713-Introduction to Java EE 7
AAI 1713-Introduction to Java EE 7AAI 1713-Introduction to Java EE 7
AAI 1713-Introduction to Java EE 7
 
Cloud compiler - Minor Project by students of CBPGEC
Cloud compiler - Minor Project by students of CBPGEC  Cloud compiler - Minor Project by students of CBPGEC
Cloud compiler - Minor Project by students of CBPGEC
 
Why jakarta ee matters (ConFoo 2021)
Why jakarta ee matters (ConFoo 2021)Why jakarta ee matters (ConFoo 2021)
Why jakarta ee matters (ConFoo 2021)
 
JSF2
JSF2JSF2
JSF2
 
Lecture 19 dynamic web - java - part 1
Lecture 19   dynamic web - java - part 1Lecture 19   dynamic web - java - part 1
Lecture 19 dynamic web - java - part 1
 
Java EE 7 Soup to Nuts at JavaOne 2014
Java EE 7 Soup to Nuts at JavaOne 2014Java EE 7 Soup to Nuts at JavaOne 2014
Java EE 7 Soup to Nuts at JavaOne 2014
 
Lecture 19 - Dynamic Web - JAVA - Part 1.ppt
Lecture 19 - Dynamic Web - JAVA - Part 1.pptLecture 19 - Dynamic Web - JAVA - Part 1.ppt
Lecture 19 - Dynamic Web - JAVA - Part 1.ppt
 
Devjyotippt
DevjyotipptDevjyotippt
Devjyotippt
 
Jakarta EE und Microprofile sind bei Azure zu Hause
Jakarta EE und Microprofile sind bei Azure zu HauseJakarta EE und Microprofile sind bei Azure zu Hause
Jakarta EE und Microprofile sind bei Azure zu Hause
 
Enterprise java unit-1_chapter-1
Enterprise java unit-1_chapter-1Enterprise java unit-1_chapter-1
Enterprise java unit-1_chapter-1
 
Showcase_Intern
Showcase_InternShowcase_Intern
Showcase_Intern
 
Ppt for Online music store
Ppt for Online music storePpt for Online music store
Ppt for Online music store
 

Plus de Josh Juneau

Plus de Josh Juneau (10)

Jakarta EE Recipes
Jakarta EE RecipesJakarta EE Recipes
Jakarta EE Recipes
 
Jakarta EE and MicroProfile Tech Talk
Jakarta EE and MicroProfile Tech TalkJakarta EE and MicroProfile Tech Talk
Jakarta EE and MicroProfile Tech Talk
 
Jakarta EE and MicroProfile - EclipseCon 2020
Jakarta EE and MicroProfile - EclipseCon 2020Jakarta EE and MicroProfile - EclipseCon 2020
Jakarta EE and MicroProfile - EclipseCon 2020
 
Jakarta EE 8: Overview of Features
Jakarta EE 8: Overview of FeaturesJakarta EE 8: Overview of Features
Jakarta EE 8: Overview of Features
 
Lightweight Java EE with MicroProfile
Lightweight Java EE with MicroProfileLightweight Java EE with MicroProfile
Lightweight Java EE with MicroProfile
 
Java EE 8 Recipes
Java EE 8 RecipesJava EE 8 Recipes
Java EE 8 Recipes
 
Java EE 8 Web Frameworks: A Look at JSF vs MVC
Java EE 8 Web Frameworks: A Look at JSF vs MVCJava EE 8 Web Frameworks: A Look at JSF vs MVC
Java EE 8 Web Frameworks: A Look at JSF vs MVC
 
Java EE 8: On the Horizon
Java EE 8:  On the HorizonJava EE 8:  On the Horizon
Java EE 8: On the Horizon
 
Java EE 7 Recipes
Java EE 7 RecipesJava EE 7 Recipes
Java EE 7 Recipes
 
Java EE 7 Recipes for Concurrency - JavaOne 2014
Java EE 7 Recipes for Concurrency - JavaOne 2014Java EE 7 Recipes for Concurrency - JavaOne 2014
Java EE 7 Recipes for Concurrency - JavaOne 2014
 

Dernier

Structuring Teams and Portfolios for Success
Structuring Teams and Portfolios for SuccessStructuring Teams and Portfolios for Success
Structuring Teams and Portfolios for Success
UXDXConf
 

Dernier (20)

Enterprise Knowledge Graphs - Data Summit 2024
Enterprise Knowledge Graphs - Data Summit 2024Enterprise Knowledge Graphs - Data Summit 2024
Enterprise Knowledge Graphs - Data Summit 2024
 
Unpacking Value Delivery - Agile Oxford Meetup - May 2024.pptx
Unpacking Value Delivery - Agile Oxford Meetup - May 2024.pptxUnpacking Value Delivery - Agile Oxford Meetup - May 2024.pptx
Unpacking Value Delivery - Agile Oxford Meetup - May 2024.pptx
 
FDO for Camera, Sensor and Networking Device – Commercial Solutions from VinC...
FDO for Camera, Sensor and Networking Device – Commercial Solutions from VinC...FDO for Camera, Sensor and Networking Device – Commercial Solutions from VinC...
FDO for Camera, Sensor and Networking Device – Commercial Solutions from VinC...
 
Powerful Start- the Key to Project Success, Barbara Laskowska
Powerful Start- the Key to Project Success, Barbara LaskowskaPowerful Start- the Key to Project Success, Barbara Laskowska
Powerful Start- the Key to Project Success, Barbara Laskowska
 
Simplified FDO Manufacturing Flow with TPMs _ Liam at Infineon.pdf
Simplified FDO Manufacturing Flow with TPMs _ Liam at Infineon.pdfSimplified FDO Manufacturing Flow with TPMs _ Liam at Infineon.pdf
Simplified FDO Manufacturing Flow with TPMs _ Liam at Infineon.pdf
 
TEST BANK For, Information Technology Project Management 9th Edition Kathy Sc...
TEST BANK For, Information Technology Project Management 9th Edition Kathy Sc...TEST BANK For, Information Technology Project Management 9th Edition Kathy Sc...
TEST BANK For, Information Technology Project Management 9th Edition Kathy Sc...
 
Introduction to FDO and How It works Applications _ Richard at FIDO Alliance.pdf
Introduction to FDO and How It works Applications _ Richard at FIDO Alliance.pdfIntroduction to FDO and How It works Applications _ Richard at FIDO Alliance.pdf
Introduction to FDO and How It works Applications _ Richard at FIDO Alliance.pdf
 
Free and Effective: Making Flows Publicly Accessible, Yumi Ibrahimzade
Free and Effective: Making Flows Publicly Accessible, Yumi IbrahimzadeFree and Effective: Making Flows Publicly Accessible, Yumi Ibrahimzade
Free and Effective: Making Flows Publicly Accessible, Yumi Ibrahimzade
 
A Business-Centric Approach to Design System Strategy
A Business-Centric Approach to Design System StrategyA Business-Centric Approach to Design System Strategy
A Business-Centric Approach to Design System Strategy
 
Microsoft CSP Briefing Pre-Engagement - Questionnaire
Microsoft CSP Briefing Pre-Engagement - QuestionnaireMicrosoft CSP Briefing Pre-Engagement - Questionnaire
Microsoft CSP Briefing Pre-Engagement - Questionnaire
 
Where to Learn More About FDO _ Richard at FIDO Alliance.pdf
Where to Learn More About FDO _ Richard at FIDO Alliance.pdfWhere to Learn More About FDO _ Richard at FIDO Alliance.pdf
Where to Learn More About FDO _ Richard at FIDO Alliance.pdf
 
Easier, Faster, and More Powerful – Notes Document Properties Reimagined
Easier, Faster, and More Powerful – Notes Document Properties ReimaginedEasier, Faster, and More Powerful – Notes Document Properties Reimagined
Easier, Faster, and More Powerful – Notes Document Properties Reimagined
 
Salesforce Adoption – Metrics, Methods, and Motivation, Antone Kom
Salesforce Adoption – Metrics, Methods, and Motivation, Antone KomSalesforce Adoption – Metrics, Methods, and Motivation, Antone Kom
Salesforce Adoption – Metrics, Methods, and Motivation, Antone Kom
 
Oauth 2.0 Introduction and Flows with MuleSoft
Oauth 2.0 Introduction and Flows with MuleSoftOauth 2.0 Introduction and Flows with MuleSoft
Oauth 2.0 Introduction and Flows with MuleSoft
 
PLAI - Acceleration Program for Generative A.I. Startups
PLAI - Acceleration Program for Generative A.I. StartupsPLAI - Acceleration Program for Generative A.I. Startups
PLAI - Acceleration Program for Generative A.I. Startups
 
Syngulon - Selection technology May 2024.pdf
Syngulon - Selection technology May 2024.pdfSyngulon - Selection technology May 2024.pdf
Syngulon - Selection technology May 2024.pdf
 
Optimizing NoSQL Performance Through Observability
Optimizing NoSQL Performance Through ObservabilityOptimizing NoSQL Performance Through Observability
Optimizing NoSQL Performance Through Observability
 
Choosing the Right FDO Deployment Model for Your Application _ Geoffrey at In...
Choosing the Right FDO Deployment Model for Your Application _ Geoffrey at In...Choosing the Right FDO Deployment Model for Your Application _ Geoffrey at In...
Choosing the Right FDO Deployment Model for Your Application _ Geoffrey at In...
 
Structuring Teams and Portfolios for Success
Structuring Teams and Portfolios for SuccessStructuring Teams and Portfolios for Success
Structuring Teams and Portfolios for Success
 
Portal Kombat : extension du réseau de propagande russe
Portal Kombat : extension du réseau de propagande russePortal Kombat : extension du réseau de propagande russe
Portal Kombat : extension du réseau de propagande russe
 

Utilizing JSF Front Ends with Microservices

  • 1. Utilizing JSF Front Ends w Microservices Code Smarter Josh Juneau Apress and Java Magazine Author JCP Member, Apache NetBeans Contributor, Java Champion, Jakarta EE Ambassadors
  • 2. About Me • Developer, DBA, System Administrator • Author, Speaker, Podcaster • Java Champion • Apache NetBeans Developer • Jakarta EE Ambassadors
  • 3. Agenda • Primer on newer features of Jakarta Server Faces and Jakarta RESTful Web Services • Simple services utilizing Jakarta EE specifications. • Basic Jakarta Server Faces front end to display and update data via RESTful web services. • Incorporation of JSF frameworks to build robust front ends.
  • 4. How to Get Started Today • Download Eclipse GlassFish 5.1.0 (Utilize Payara 5.194+ for JDK 11 support) • https://projects.eclipse.org/projects/ ee4j.glassfish • Include Jakarta EE 8 dependencies into your project • Great examples: • https://github.com/juneau001/JakartaEE-Playground • https://projects.eclipse.org/projects/ee4j.jakartaee-platform/
  • 5. Jakarta EE 8 Overview • Continued enhancements for productivity and web standards alignment • Better alignment with Java SE 8 • Work towards a better platform for development of microservices
  • 6. Jakarta Server Faces • Enhanced CDI Alignment • WebSocket Integration • Ajax Method Invocation • Class LevelValidation • Java 8 Date-Time • Iterable/Map/Custom UIData Support • Component Search Expressions • Radio Button • styleclass on h:column • Basic Support for Extensionless URLs New Features with 2.3
  • 7. Utilize Date-Time API Make use of the <f:convertDateTime /> tag. New type attribute values on <f:convertDateTime>: • localDate, localTime, localDateTime • offsetTime,offsetDateTime, zonedDateTime
  • 8. Jakarta Server Faces 3.0 • Removal of old cruft • JSF’s own expression language • Managed Beans • Move more artifacts towards CDI • Action Model (Not to compete with Krazo) • Extensionless Mapping
  • 9. Resource Injection Inject JSF artifacts in JSF 2.3, and even possible to inject into other JSF artifacts. @Inject private ExternalContext externalContext; @Inject private ServletContext servletContext;
  • 10. How it Works JSF 2.3 provides default producers for many of the most commonly used JSF artifacts, therefore, we can now inject rather than hard-code. Converters, validators and behaviors are now also injection targets.
  • 12. Jakarta API for RESTful Web Services • Improved CDI Integration • Reactive Client API • Non-Blocking I/O • https://github.com/jax-rs/spec
  • 13. • Server Sent Events • One way communication channel • Text protocol,“text/event-stream” media type • Multiple messages • Retry interval Jakarta API for RESTful Web Services
  • 14. Building a Simple Service • JAX-RS • JPA • BeanValidation
  • 15. Using JSF for Front End • Model: Model Classes • View: Facelets • Controller: CDI Beans • Wire together with Expression Language
  • 16. Front End Service • Utilize JAX-RS (RESTful Web Services) client • All database work occurs within the microservice (JPA, EJB if needed) • Utilize JAX-RS to provide data to client
  • 17. JAX-RS Client Client client = ClientBuilder.newClient(); WebTarget resource = client.target(clientUri).path(clientService); List<Roster> rosterList = resource.request(javax.ws.rs.core.MediaType.APPLICATION_XML) .get(new GenericType<List<Roster>>() { })
  • 19. Communicate (Demo) • Basic communication to display database table data
  • 20. Writing or Modifying Data • Utilize @PUT and @POST
  • 23. Writing or Modifying Data • Demo Utilizing JAX-RS forms and responses
  • 25. SecureYour Services! • Recommend using OAUTH or LDAP authentication, generating token • Utilize JWT to secure endpoints • MicroProfile JWT
  • 26. Dozens of Libraries • PrimeFaces • ButterFaces • MyFaces • OmniFaces (Utilities)
  • 27. Summary • Utilize microservices with JPA and JAX-RS to build database communication • Create front-ends using JSF, CDI, JAX-RS • Utilize third party libraries for limitless options