SlideShare une entreprise Scribd logo
1  sur  29
Télécharger pour lire hors ligne
JavaServer Faces
     in the Cloud
Using Google App Engine for your
     JSF 2.x web application



                Andy Bosch
      Independent consultant and trainer
Agenda

 Clouds and the Google App Engine

 A first HelloWorld with GAE

 Introducing JSF 2.0

 JSF 2.0 and GAE

 Component libraries and GAE

 Conclusion
Who am I?
  Name: Andy Bosch
  Trainer, coach, developer, …
  Specialized on JSF and portlets
  Expert Group member of JSR-301 and JSR-329
  Working with JSF since 2004
Agenda

 Clouds and the Google App Engine

 A first HelloWorld with GAE

 Introducing JSF 2.0

 JSF 2.0 and GAE

 Component libraries and GAE

 Conclusion
Everything is in the Cloud


     Software
     - SaaS -                Platform
                             - PaaS -



           Infrastructure
               - IaaS -
What is GAE?
 Google App Engine
 lets you run your web applications
 on Google's infrastructure.
Why should I use it?

 App Engine applications are easy to build, easy to
 maintain, and easy to scale as your traffic and data
 storage needs to grow.


 With App Engine, there are no servers to maintain:
 You just upload your application, and it's ready to
 serve your users.
More details, please

 AppServer which supports most of the common
 technologies

 Automatic scaling and load balancing

 Transactional and highly scalable database model

 Integration into Google accounts through APIs
The environment

 In the background, Jetty is used

 To be more precise: 10s of thousands of Jettys



  A servlet container, not an application server!
Full Java support?

 Almost, but there are some restrictions:
  • Cannot write to the file system
  • Cannot open socket connections
  • Cannot start new threads
  • …

 The restrictions are build into the Java runtime
 environment

 If there are security violations, runtime exceptions are
 thrown
Tooling environment

 Eclipse with plug-ins

 SDK with web server application that emulates all of
 the App Engine services

 Admin console

 Plenty of online documentations
Five steps to a hello world

1. Install SDK

2. Create GAE account

3. Create the application

4. Create project

5. Upload project
Agenda

 Clouds and the Google App Engine

 A first HelloWorld with GAE

 Introducing JSF 2.0

 JSF 2.0 and GAE

 Component libraries and GAE

 Conclusion
Introducing JSF 2.1

 XHtml instead of JSP

 Ajax Integration

 Resource Handling

 Annotation Support

 View templating

 Composite Components
JSF 2.0 and GAE

 During the first months of JSF 2.0, there were several
 issues causing some troubles

 Nowadays, both Mojarra and MyFaces can be used
 with GAE

 A couple of minimal things have to be considered
A simple JSF page


<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core”>
<h:head>
    <title>JSF 2.0 Hello World</title>
</h:head>
<h:body>
  <h:form>
    <h:outputText value=”Hi there” />
  </h:form>
</h:body>
</html>
EL-bug

  Known bug in JSP support

  Google AppEngine Issue 1506 (marked as fixed)

  JSP 2.1 not fully supported

  Workaround with explicitly defined el factory

<context-param>
<param-name>com.sun.faces.expressionFactory</param-name>
<param-value>com.sun.el.ExpressionFactoryImpl</param-value>
</context-param>
Disable multi-threading

 GAE doesn't support multi-threaded applications
<context-param>
  <param-name>
    com.sun.faces.enableMultiThreadedStartup
  </param-name>
  <param-value>false</param-value>
</context-param>

<context-param>
  <param-name>com.sun.faces.enableThreading</param-name>
  <param-value>false</param-value>
</context-param>
Enable sessions

<?xml version="1.0" encoding="utf-8"?>
  <appengine-web-app
  xmlns="http://appengine.google.com/ns/1.0">

  <application></application>
  <version>1</version>
  <sessions-enabled>true</sessions-enabled>
  ...



</appengine-web-app>
Disable JNDI in Mojarra classes

 JNDI is not supported in GAE

 Patched version of Mojarra
I want to see it now !

  With those mentioned changes the HelloWorld app
  should already be able to be deployed
Let‘s try out some more: JSF 2.x features

 Composite Components

 Resource Handling

 Systemevents

 Beanvalidation

 Viewparameter

 Ajax
Composite Components (1)
  DRY – Don‘t repeat yourself
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:cc="http://java.sun.com/jsf/composite/helloLib">
<h:head>
    <title>CC Demo</title>
</h:head>
<h:body>
  <h:form>
    <cc:hello value=”Andy Bosch” />
  </h:form>
</h:body>
</html>
Composite Components (2)
 hello.xhtml
<html xmlns="http://www.w3.org/1999/xhtml"
  xmlns:h="http://java.sun.com/jsf/html"
  xmlns:f="http://java.sun.com/jsf/core"
  xmlns:composite="http://java.sun.com/jsf/composite">
<body>
  <composite:interface>
    <composite:attribute name="value" required="true" />
  </composite:interface>
  <composite:implementation>
    <h:outputText
        value=”Hello #{cc.attrs.value}” />
  </composite:implementation>
</body>
</html>
Using Ajax
 “Parrot“ example

 When typing a key, the output should be repeated


 <h:panelGrid columns="2">
    <h:outputText value=„Your name: " />
    <h:inputText value="#{personBean.lastname}">
       <f:ajax render="@form" />
    </h:inputText>

    <h:outputText value=„Again your name: " />
    <h:outputText value="#{personBean.lastname}" />
 </h:panelGrid>
Component libraries
 JSF has a powerful ecosystem of additional component
 libraries

 Not all of them can be used in combination with the
 GAE

 RichFaces and ICEfaces did have some minor
 problems, but all entries in Jira are “fixed“ now.

 PrimeFaces is working !
Links and Resources
 http://bit.ly/8U6Ebn
 JSF 2.0 and GAE

 http://in.relation.to/Bloggers/WeldJSF20AndGoogleApp
 EngineNavigatingTheMinefieldPart1

 http://myfaces.apache.org/core20/googleappenginesup
 port.html

 http://primefaces-rocks.appspot.com/ui/home.jsf
Q&A?
       More trainings:
       www.jsf-academy.com

       Contact:
       andy.bosch@jsf-academy.com

       Twitter:
       @andybosch
Evaluation Forms:

   JavaServer Faces
     in the Cloud

Presented by: Andy Bosch

Contenu connexe

Tendances

Building Progressive Web Apps for Android and iOS
Building Progressive Web Apps for Android and iOSBuilding Progressive Web Apps for Android and iOS
Building Progressive Web Apps for Android and iOSFITC
 
Getting Started with React v16
Getting Started with React v16Getting Started with React v16
Getting Started with React v16Benny Neugebauer
 
Building a Spring Boot Application - Ask the Audience!
Building a Spring Boot Application - Ask the Audience!Building a Spring Boot Application - Ask the Audience!
Building a Spring Boot Application - Ask the Audience!🎤 Hanno Embregts 🎸
 
06. Android Basic Widget and Container
06. Android Basic Widget and Container06. Android Basic Widget and Container
06. Android Basic Widget and ContainerOum Saokosal
 
Progressive Web Apps 101
Progressive Web Apps 101Progressive Web Apps 101
Progressive Web Apps 101Muhammad Samu
 
Vue.js Getting Started
Vue.js Getting StartedVue.js Getting Started
Vue.js Getting StartedMurat Doğan
 
Automating Web Application Deployment
Automating Web Application DeploymentAutomating Web Application Deployment
Automating Web Application DeploymentMathew Byrne
 
An Introduction to Django Web Framework
An Introduction to Django Web FrameworkAn Introduction to Django Web Framework
An Introduction to Django Web FrameworkDavid Gibbons
 
UI5CN Live Webinar for FAQ and Q&A on 08th June
UI5CN Live Webinar for FAQ and Q&A on 08th JuneUI5CN Live Webinar for FAQ and Q&A on 08th June
UI5CN Live Webinar for FAQ and Q&A on 08th JuneAJAY NAYAK
 
Maven, Eclipse And OSGi Working Together
Maven, Eclipse And OSGi Working TogetherMaven, Eclipse And OSGi Working Together
Maven, Eclipse And OSGi Working TogetherCarlos Sanchez
 
Progressive Web Apps
Progressive Web AppsProgressive Web Apps
Progressive Web AppsFITC
 
Eclipse IAM, Maven Integration For Eclipse
Eclipse IAM, Maven Integration For EclipseEclipse IAM, Maven Integration For Eclipse
Eclipse IAM, Maven Integration For EclipseCarlos Sanchez
 
How to Implement Basic Angular Routing and Nested Routing With Params in Angu...
How to Implement Basic Angular Routing and Nested Routing With Params in Angu...How to Implement Basic Angular Routing and Nested Routing With Params in Angu...
How to Implement Basic Angular Routing and Nested Routing With Params in Angu...Katy Slemon
 
Up & running with ECMAScript6
Up & running with ECMAScript6Up & running with ECMAScript6
Up & running with ECMAScript6Nir Kaufman
 
The Google App Engine Oil Framework
The Google App Engine Oil FrameworkThe Google App Engine Oil Framework
The Google App Engine Oil FrameworkEric ShangKuan
 
Web Components: Web back to future.
Web Components: Web back to future.Web Components: Web back to future.
Web Components: Web back to future.GlobalLogic Ukraine
 
Q4E and Eclipse IAM, Maven integration for Eclipse
Q4E and Eclipse IAM, Maven integration for EclipseQ4E and Eclipse IAM, Maven integration for Eclipse
Q4E and Eclipse IAM, Maven integration for EclipseCarlos Sanchez
 

Tendances (20)

Building Progressive Web Apps for Android and iOS
Building Progressive Web Apps for Android and iOSBuilding Progressive Web Apps for Android and iOS
Building Progressive Web Apps for Android and iOS
 
An introduction to Vue.js
An introduction to Vue.jsAn introduction to Vue.js
An introduction to Vue.js
 
Getting Started with React v16
Getting Started with React v16Getting Started with React v16
Getting Started with React v16
 
Building a Spring Boot Application - Ask the Audience!
Building a Spring Boot Application - Ask the Audience!Building a Spring Boot Application - Ask the Audience!
Building a Spring Boot Application - Ask the Audience!
 
06. Android Basic Widget and Container
06. Android Basic Widget and Container06. Android Basic Widget and Container
06. Android Basic Widget and Container
 
Progressive Web Apps 101
Progressive Web Apps 101Progressive Web Apps 101
Progressive Web Apps 101
 
Codegnitorppt
CodegnitorpptCodegnitorppt
Codegnitorppt
 
AEM responsive
AEM responsiveAEM responsive
AEM responsive
 
Vue.js Getting Started
Vue.js Getting StartedVue.js Getting Started
Vue.js Getting Started
 
Automating Web Application Deployment
Automating Web Application DeploymentAutomating Web Application Deployment
Automating Web Application Deployment
 
An Introduction to Django Web Framework
An Introduction to Django Web FrameworkAn Introduction to Django Web Framework
An Introduction to Django Web Framework
 
UI5CN Live Webinar for FAQ and Q&A on 08th June
UI5CN Live Webinar for FAQ and Q&A on 08th JuneUI5CN Live Webinar for FAQ and Q&A on 08th June
UI5CN Live Webinar for FAQ and Q&A on 08th June
 
Maven, Eclipse And OSGi Working Together
Maven, Eclipse And OSGi Working TogetherMaven, Eclipse And OSGi Working Together
Maven, Eclipse And OSGi Working Together
 
Progressive Web Apps
Progressive Web AppsProgressive Web Apps
Progressive Web Apps
 
Eclipse IAM, Maven Integration For Eclipse
Eclipse IAM, Maven Integration For EclipseEclipse IAM, Maven Integration For Eclipse
Eclipse IAM, Maven Integration For Eclipse
 
How to Implement Basic Angular Routing and Nested Routing With Params in Angu...
How to Implement Basic Angular Routing and Nested Routing With Params in Angu...How to Implement Basic Angular Routing and Nested Routing With Params in Angu...
How to Implement Basic Angular Routing and Nested Routing With Params in Angu...
 
Up & running with ECMAScript6
Up & running with ECMAScript6Up & running with ECMAScript6
Up & running with ECMAScript6
 
The Google App Engine Oil Framework
The Google App Engine Oil FrameworkThe Google App Engine Oil Framework
The Google App Engine Oil Framework
 
Web Components: Web back to future.
Web Components: Web back to future.Web Components: Web back to future.
Web Components: Web back to future.
 
Q4E and Eclipse IAM, Maven integration for Eclipse
Q4E and Eclipse IAM, Maven integration for EclipseQ4E and Eclipse IAM, Maven integration for Eclipse
Q4E and Eclipse IAM, Maven integration for Eclipse
 

Similaire à Andy Bosch - JavaServer Faces in the cloud

Developing Java Web Applications
Developing Java Web ApplicationsDeveloping Java Web Applications
Developing Java Web Applicationshchen1
 
Modular Test-driven SPAs with Spring and AngularJS
Modular Test-driven SPAs with Spring and AngularJSModular Test-driven SPAs with Spring and AngularJS
Modular Test-driven SPAs with Spring and AngularJSGunnar Hillert
 
Angularjs Tutorial for Beginners
Angularjs Tutorial for BeginnersAngularjs Tutorial for Beginners
Angularjs Tutorial for Beginnersrajkamaltibacademy
 
Google App Engine for Java
Google App Engine for JavaGoogle App Engine for Java
Google App Engine for JavaLars Vogel
 
Google App Engine for Java
Google App Engine for JavaGoogle App Engine for Java
Google App Engine for JavaLars Vogel
 
Java Web Programming on Google Cloud Platform [3/3] : Google Web Toolkit
Java Web Programming on Google Cloud Platform [3/3] : Google Web ToolkitJava Web Programming on Google Cloud Platform [3/3] : Google Web Toolkit
Java Web Programming on Google Cloud Platform [3/3] : Google Web ToolkitIMC Institute
 
Apache Cordova In Action
Apache Cordova In ActionApache Cordova In Action
Apache Cordova In ActionHazem Saleh
 
The Web on OSGi: Here's How
The Web on OSGi: Here's HowThe Web on OSGi: Here's How
The Web on OSGi: Here's Howmrdon
 
eXo Platform SEA - Play Framework Introduction
eXo Platform SEA - Play Framework IntroductioneXo Platform SEA - Play Framework Introduction
eXo Platform SEA - Play Framework Introductionvstorm83
 
GWT training session 1
GWT training session 1GWT training session 1
GWT training session 1SNEHAL MASNE
 
Using HttpWatch Plug-in with Selenium Automation in Java
Using HttpWatch Plug-in with Selenium Automation in JavaUsing HttpWatch Plug-in with Selenium Automation in Java
Using HttpWatch Plug-in with Selenium Automation in JavaSandeep Tol
 
Rest web service_with_spring_hateoas
Rest web service_with_spring_hateoasRest web service_with_spring_hateoas
Rest web service_with_spring_hateoasZeid Hassan
 
What's cool in Apache MyFaces?
What's cool in Apache MyFaces?What's cool in Apache MyFaces?
What's cool in Apache MyFaces?aliok
 
CollabSphere 2021 - DEV114 - The Nuts and Bolts of CI/CD With a Large XPages ...
CollabSphere 2021 - DEV114 - The Nuts and Bolts of CI/CD With a Large XPages ...CollabSphere 2021 - DEV114 - The Nuts and Bolts of CI/CD With a Large XPages ...
CollabSphere 2021 - DEV114 - The Nuts and Bolts of CI/CD With a Large XPages ...Jesse Gallagher
 
Introduction to Google App Engine with Python
Introduction to Google App Engine with PythonIntroduction to Google App Engine with Python
Introduction to Google App Engine with PythonBrian Lyttle
 
Front End Development for Back End Developers - UberConf 2017
Front End Development for Back End Developers - UberConf 2017Front End Development for Back End Developers - UberConf 2017
Front End Development for Back End Developers - UberConf 2017Matt Raible
 
ASP.NET AJAX with Visual Studio 2008
ASP.NET AJAX with Visual Studio 2008ASP.NET AJAX with Visual Studio 2008
ASP.NET AJAX with Visual Studio 2008Caleb Jenkins
 

Similaire à Andy Bosch - JavaServer Faces in the cloud (20)

Developing Java Web Applications
Developing Java Web ApplicationsDeveloping Java Web Applications
Developing Java Web Applications
 
Modular Test-driven SPAs with Spring and AngularJS
Modular Test-driven SPAs with Spring and AngularJSModular Test-driven SPAs with Spring and AngularJS
Modular Test-driven SPAs with Spring and AngularJS
 
JSF 2.0 Preview
JSF 2.0 PreviewJSF 2.0 Preview
JSF 2.0 Preview
 
Angularjs Tutorial for Beginners
Angularjs Tutorial for BeginnersAngularjs Tutorial for Beginners
Angularjs Tutorial for Beginners
 
Google App Engine for Java
Google App Engine for JavaGoogle App Engine for Java
Google App Engine for Java
 
Google Web Toolkit
Google Web ToolkitGoogle Web Toolkit
Google Web Toolkit
 
Google App Engine for Java
Google App Engine for JavaGoogle App Engine for Java
Google App Engine for Java
 
Java Web Programming on Google Cloud Platform [3/3] : Google Web Toolkit
Java Web Programming on Google Cloud Platform [3/3] : Google Web ToolkitJava Web Programming on Google Cloud Platform [3/3] : Google Web Toolkit
Java Web Programming on Google Cloud Platform [3/3] : Google Web Toolkit
 
Apache Cordova In Action
Apache Cordova In ActionApache Cordova In Action
Apache Cordova In Action
 
The Web on OSGi: Here's How
The Web on OSGi: Here's HowThe Web on OSGi: Here's How
The Web on OSGi: Here's How
 
eXo Platform SEA - Play Framework Introduction
eXo Platform SEA - Play Framework IntroductioneXo Platform SEA - Play Framework Introduction
eXo Platform SEA - Play Framework Introduction
 
GWT training session 1
GWT training session 1GWT training session 1
GWT training session 1
 
Using HttpWatch Plug-in with Selenium Automation in Java
Using HttpWatch Plug-in with Selenium Automation in JavaUsing HttpWatch Plug-in with Selenium Automation in Java
Using HttpWatch Plug-in with Selenium Automation in Java
 
Rest web service_with_spring_hateoas
Rest web service_with_spring_hateoasRest web service_with_spring_hateoas
Rest web service_with_spring_hateoas
 
What's cool in Apache MyFaces?
What's cool in Apache MyFaces?What's cool in Apache MyFaces?
What's cool in Apache MyFaces?
 
CollabSphere 2021 - DEV114 - The Nuts and Bolts of CI/CD With a Large XPages ...
CollabSphere 2021 - DEV114 - The Nuts and Bolts of CI/CD With a Large XPages ...CollabSphere 2021 - DEV114 - The Nuts and Bolts of CI/CD With a Large XPages ...
CollabSphere 2021 - DEV114 - The Nuts and Bolts of CI/CD With a Large XPages ...
 
Introduction to Google App Engine with Python
Introduction to Google App Engine with PythonIntroduction to Google App Engine with Python
Introduction to Google App Engine with Python
 
Google App Engine
Google App EngineGoogle App Engine
Google App Engine
 
Front End Development for Back End Developers - UberConf 2017
Front End Development for Back End Developers - UberConf 2017Front End Development for Back End Developers - UberConf 2017
Front End Development for Back End Developers - UberConf 2017
 
ASP.NET AJAX with Visual Studio 2008
ASP.NET AJAX with Visual Studio 2008ASP.NET AJAX with Visual Studio 2008
ASP.NET AJAX with Visual Studio 2008
 

Dernier

Vector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptxVector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptxRemote DBA Services
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...apidays
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdfSandro Moreira
 
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​Bhuvaneswari Subramani
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Victor Rentea
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FMESafe Software
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Angeliki Cooney
 
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot ModelMcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot ModelDeepika Singh
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...apidays
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Victor Rentea
 
WSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering DevelopersWSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering DevelopersWSO2
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Jeffrey Haguewood
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodJuan lago vázquez
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...Zilliz
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoffsammart93
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...apidays
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusZilliz
 

Dernier (20)

Vector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptxVector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptx
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf
 
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
 
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot ModelMcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
 
WSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering DevelopersWSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering Developers
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with Milvus
 

Andy Bosch - JavaServer Faces in the cloud

  • 1. JavaServer Faces in the Cloud Using Google App Engine for your JSF 2.x web application Andy Bosch Independent consultant and trainer
  • 2. Agenda Clouds and the Google App Engine A first HelloWorld with GAE Introducing JSF 2.0 JSF 2.0 and GAE Component libraries and GAE Conclusion
  • 3. Who am I? Name: Andy Bosch Trainer, coach, developer, … Specialized on JSF and portlets Expert Group member of JSR-301 and JSR-329 Working with JSF since 2004
  • 4. Agenda Clouds and the Google App Engine A first HelloWorld with GAE Introducing JSF 2.0 JSF 2.0 and GAE Component libraries and GAE Conclusion
  • 5. Everything is in the Cloud Software - SaaS - Platform - PaaS - Infrastructure - IaaS -
  • 6. What is GAE? Google App Engine lets you run your web applications on Google's infrastructure.
  • 7. Why should I use it? App Engine applications are easy to build, easy to maintain, and easy to scale as your traffic and data storage needs to grow. With App Engine, there are no servers to maintain: You just upload your application, and it's ready to serve your users.
  • 8. More details, please AppServer which supports most of the common technologies Automatic scaling and load balancing Transactional and highly scalable database model Integration into Google accounts through APIs
  • 9. The environment In the background, Jetty is used To be more precise: 10s of thousands of Jettys A servlet container, not an application server!
  • 10. Full Java support? Almost, but there are some restrictions: • Cannot write to the file system • Cannot open socket connections • Cannot start new threads • … The restrictions are build into the Java runtime environment If there are security violations, runtime exceptions are thrown
  • 11. Tooling environment Eclipse with plug-ins SDK with web server application that emulates all of the App Engine services Admin console Plenty of online documentations
  • 12. Five steps to a hello world 1. Install SDK 2. Create GAE account 3. Create the application 4. Create project 5. Upload project
  • 13. Agenda Clouds and the Google App Engine A first HelloWorld with GAE Introducing JSF 2.0 JSF 2.0 and GAE Component libraries and GAE Conclusion
  • 14. Introducing JSF 2.1 XHtml instead of JSP Ajax Integration Resource Handling Annotation Support View templating Composite Components
  • 15. JSF 2.0 and GAE During the first months of JSF 2.0, there were several issues causing some troubles Nowadays, both Mojarra and MyFaces can be used with GAE A couple of minimal things have to be considered
  • 16. A simple JSF page <html xmlns="http://www.w3.org/1999/xhtml" xmlns:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core”> <h:head> <title>JSF 2.0 Hello World</title> </h:head> <h:body> <h:form> <h:outputText value=”Hi there” /> </h:form> </h:body> </html>
  • 17. EL-bug Known bug in JSP support Google AppEngine Issue 1506 (marked as fixed) JSP 2.1 not fully supported Workaround with explicitly defined el factory <context-param> <param-name>com.sun.faces.expressionFactory</param-name> <param-value>com.sun.el.ExpressionFactoryImpl</param-value> </context-param>
  • 18. Disable multi-threading GAE doesn't support multi-threaded applications <context-param> <param-name> com.sun.faces.enableMultiThreadedStartup </param-name> <param-value>false</param-value> </context-param> <context-param> <param-name>com.sun.faces.enableThreading</param-name> <param-value>false</param-value> </context-param>
  • 19. Enable sessions <?xml version="1.0" encoding="utf-8"?> <appengine-web-app xmlns="http://appengine.google.com/ns/1.0"> <application></application> <version>1</version> <sessions-enabled>true</sessions-enabled> ... </appengine-web-app>
  • 20. Disable JNDI in Mojarra classes JNDI is not supported in GAE Patched version of Mojarra
  • 21. I want to see it now ! With those mentioned changes the HelloWorld app should already be able to be deployed
  • 22. Let‘s try out some more: JSF 2.x features Composite Components Resource Handling Systemevents Beanvalidation Viewparameter Ajax
  • 23. Composite Components (1) DRY – Don‘t repeat yourself <html xmlns="http://www.w3.org/1999/xhtml" xmlns:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core" xmlns:cc="http://java.sun.com/jsf/composite/helloLib"> <h:head> <title>CC Demo</title> </h:head> <h:body> <h:form> <cc:hello value=”Andy Bosch” /> </h:form> </h:body> </html>
  • 24. Composite Components (2) hello.xhtml <html xmlns="http://www.w3.org/1999/xhtml" xmlns:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core" xmlns:composite="http://java.sun.com/jsf/composite"> <body> <composite:interface> <composite:attribute name="value" required="true" /> </composite:interface> <composite:implementation> <h:outputText value=”Hello #{cc.attrs.value}” /> </composite:implementation> </body> </html>
  • 25. Using Ajax “Parrot“ example When typing a key, the output should be repeated <h:panelGrid columns="2"> <h:outputText value=„Your name: " /> <h:inputText value="#{personBean.lastname}"> <f:ajax render="@form" /> </h:inputText> <h:outputText value=„Again your name: " /> <h:outputText value="#{personBean.lastname}" /> </h:panelGrid>
  • 26. Component libraries JSF has a powerful ecosystem of additional component libraries Not all of them can be used in combination with the GAE RichFaces and ICEfaces did have some minor problems, but all entries in Jira are “fixed“ now. PrimeFaces is working !
  • 27. Links and Resources http://bit.ly/8U6Ebn JSF 2.0 and GAE http://in.relation.to/Bloggers/WeldJSF20AndGoogleApp EngineNavigatingTheMinefieldPart1 http://myfaces.apache.org/core20/googleappenginesup port.html http://primefaces-rocks.appspot.com/ui/home.jsf
  • 28. Q&A? More trainings: www.jsf-academy.com Contact: andy.bosch@jsf-academy.com Twitter: @andybosch
  • 29. Evaluation Forms: JavaServer Faces in the Cloud Presented by: Andy Bosch