SlideShare a Scribd company logo
1 of 28
Download to read offline
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

More Related Content

Similar to Utilizing JSF Front Ends with Microservices

Migrating to Jakarta EE 10
Migrating to Jakarta EE 10Migrating to Jakarta EE 10
Migrating to Jakarta EE 10Josh Juneau
 
Java EE8 - by Kito Mann
Java EE8 - by Kito Mann Java EE8 - by Kito Mann
Java EE8 - by Kito Mann Kile Niklawski
 
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 SFJUGMarakana Inc.
 
Java EE 6, Eclipse @ EclipseCon
Java EE 6, Eclipse @ EclipseConJava EE 6, Eclipse @ EclipseCon
Java EE 6, Eclipse @ EclipseConLudovic Champenois
 
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 StrategyMohamed Taman
 
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 7WASdev Community
 
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 7Kevin Sutter
 
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 vipin kumar
 
Why jakarta ee matters (ConFoo 2021)
Why jakarta ee matters (ConFoo 2021)Why jakarta ee matters (ConFoo 2021)
Why jakarta ee matters (ConFoo 2021)Ryan Cuprak
 
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 2014Arun Gupta
 
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.pptKalsoomTahir2
 
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 HauseEdward Burns
 
Enterprise java unit-1_chapter-1
Enterprise java unit-1_chapter-1Enterprise java unit-1_chapter-1
Enterprise java unit-1_chapter-1sandeep54552
 
Ppt for Online music store
Ppt for Online music storePpt for Online music store
Ppt for Online music storeADEEBANADEEM
 

Similar to 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
 

More from Josh Juneau

Jakarta EE Recipes
Jakarta EE RecipesJakarta EE Recipes
Jakarta EE RecipesJosh Juneau
 
Jakarta EE and MicroProfile Tech Talk
Jakarta EE and MicroProfile Tech TalkJakarta EE and MicroProfile Tech Talk
Jakarta EE and MicroProfile Tech TalkJosh Juneau
 
Jakarta EE and MicroProfile - EclipseCon 2020
Jakarta EE and MicroProfile - EclipseCon 2020Jakarta EE and MicroProfile - EclipseCon 2020
Jakarta EE and MicroProfile - EclipseCon 2020Josh Juneau
 
Jakarta EE 8: Overview of Features
Jakarta EE 8: Overview of FeaturesJakarta EE 8: Overview of Features
Jakarta EE 8: Overview of FeaturesJosh Juneau
 
Lightweight Java EE with MicroProfile
Lightweight Java EE with MicroProfileLightweight Java EE with MicroProfile
Lightweight Java EE with MicroProfileJosh Juneau
 
Java EE 8 Recipes
Java EE 8 RecipesJava EE 8 Recipes
Java EE 8 RecipesJosh Juneau
 
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 MVCJosh Juneau
 
Java EE 8: On the Horizon
Java EE 8:  On the HorizonJava EE 8:  On the Horizon
Java EE 8: On the HorizonJosh Juneau
 
Java EE 7 Recipes
Java EE 7 RecipesJava EE 7 Recipes
Java EE 7 RecipesJosh Juneau
 
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 2014Josh Juneau
 

More from 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
 

Recently uploaded

08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersThousandEyes
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...HostedbyConfluent
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Patryk Bandurski
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Scott Keck-Warren
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitecturePixlogix Infotech
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
Hyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your Budget
Hyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your BudgetHyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your Budget
Hyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your BudgetEnjoy Anytime
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxOnBoard
 
Next-generation AAM aircraft unveiled by Supernal, S-A2
Next-generation AAM aircraft unveiled by Supernal, S-A2Next-generation AAM aircraft unveiled by Supernal, S-A2
Next-generation AAM aircraft unveiled by Supernal, S-A2Hyundai Motor Group
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...shyamraj55
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
 
Artificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraArtificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraDeakin University
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure servicePooja Nehwal
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksSoftradix Technologies
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationSafe Software
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 3652toLead Limited
 

Recently uploaded (20)

08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC Architecture
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
Hyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your Budget
Hyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your BudgetHyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your Budget
Hyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your Budget
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptx
 
Next-generation AAM aircraft unveiled by Supernal, S-A2
Next-generation AAM aircraft unveiled by Supernal, S-A2Next-generation AAM aircraft unveiled by Supernal, S-A2
Next-generation AAM aircraft unveiled by Supernal, S-A2
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
 
The transition to renewables in India.pdf
The transition to renewables in India.pdfThe transition to renewables in India.pdf
The transition to renewables in India.pdf
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
 
Artificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraArtificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning era
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other Frameworks
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
 

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