Tata AIG General Insurance Company - Insurer Innovation Award 2024
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
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>
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