SlideShare a Scribd company logo
Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Public1
Consuming Java EE
in Desktop, Web, and Mobile Frontends
Geertjan Wielenga
Oracle Developer Tools
geertjan.wielenga@oracle.com
@geertjanw
Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Public2 Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Public
Agenda  JavaScript/HTML5 Rich Client
Landscape
 Java EE 7
 Java EE + JavaScript
 Tools and Technologies
 Demos
Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Public3
JavaScript/HTML5 Rich Clients Landscape
 The thin client vs. rich client debate is pretty old…
» Thin Client
- All processing on server
- Round tripping to server
- Delays…
» Thin Client Rich Client
» - Complex, dynamic
» - Feature-rich UI
» - Access local resources
Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Public4
JavaScript/HTML5 Rich Clients Landscape
 Server side frameworks have ruled for a while
– Everything on the server
 Spring / Hibernate
 JSF
 Struts
 Tapestry
 AJAX is a mild shift to the client, “best of both worlds approach”
– Asynchronous partial page refresh solutions
 PrimeFaces
 Wicket
 GWT
 Vaadin
Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Public5
Demo: PrimeFaces, Java EE, and Maven
Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Public6
JavaScript/HTML5 Rich Clients Landscape
Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Public7
JavaScript/HTML5 Rich Clients Landscape
 Rich clients powered by JS/HTML appear to be making a comeback
– Improving JavaScript engines
 V8
 *Monkey
 Nashorn
– Better tools
 jQuery
 MV* Frameworks
 Chrome, FireFox
– Standards advancement
 CSS3
 HTML5
 WebSocket
Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Public8
Perhaps Not A Slam Dunk?
 Richer clients clearly better at some things
– Highly dynamic, interactive interfaces
– Complex, feature-rich UIs
– “Single page applications” (“Applets” )
 But perhaps not a panacea
– Heavily form/workflow driven applications
– Server-side rendering still a better bet for performance/reliability?
– JavaScript/HTML development is not without it’s pains…
– Server-side frameworks are a strong incumbent
 Co-existence in the short and long term?
– Islands of rich client functionality within server-centric UIs?
– Different strokes for different folks?
Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Public9
My Big Fat Rich-Client Architecture
 Very similar to client/server architecture of lore
– Client responsible for UI rendering, basic input validation, logic and state
– Server responsible for business logic, domain model, persistence
– Web/HTTP is glue that connects client and server
 Typical communication protocols
– REST for majority of cases
– WebSocket when full-duplex communication is needed
– JavaScript tools support REST well, but not WebSocket (yet)
 The typical (ideal?) data interchange format is JSON
 Java EE is a great server-side platform for this architecture…
Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Public10
Java EE + JavaScript
EJB 3
Servlet
CDI
JPA
JAX-RS
BeanValidation
Java API for
WebSocket
Java API for
JSON
JMS JTA
JavaScript/HTML5
JAXB
JCA
Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Public11
JAX-RS
 REST development API for Java
 Server and client
 Annotation based, declarative
– @Path, @GET, @POST, @PUT, @DELETE, @PathParam,
@QueryParam, @Produces, @Consumes
 Pluggable and extensible
– Providers, filters, interceptors
Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Public12
JAX-RS Example
@Path("/atm/{cardId}")
public class AtmService {
@GET
@Path("/balance")
@Produces("text/plain")
public String balance(
@PathParam("cardId") String card,
@QueryParam("pin") String pin) {
return Double.toString(getBalance(card, pin));
}
...
Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Public13
Java API for WebSocket
 High level declarative API for WebSocket
 Both client and server-side
 Small, powerful API
– @ServerEndpoint, @OnOpen, @OnClose, @OnMessage,
@OnError, Session, Remote
 Pluggable and extensible
– Encoders, decoders, sub-protocols
Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Public14
WebSocket Example
@ServerEndpoint("/chat")
public class ChatBean {
Set<Session> peers = Collections.synchronizedSet(…);
@OnOpen
public void onOpen(Session peer) {
peers.add(peer);
}
@OnClose
public void onClose(Session peer) {
peers.remove(peer);
}
...
Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Public15
JavaScript Movers and Shakers
Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Public16
Demo: Backbone.js, Java EE, and Maven
Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Public17
Demo: Angular.js
Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Public18
Useful New Tools and Technologies
Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Public19
Useful New Tools and Technologies
 Post Processors
– Emmet
– SASS/LESS
– CoffeeScript
 Cordova/PhoneGap
 HTML5 Ecosystem
– Grunt
– Karma
– Bower
– Yeoman
Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Public20
Demo: SASS, LESS, Karma, Cordova
Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Public21
But Browser/Phone Is Not For Everyone…
Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Public22
Summary
 JavaScript/HTML5 clients gaining traction as opposed to server-side
web frameworks
 Communication between the client and server happens via JSON
over REST or WebSocket
 Java EE well positioned as a JavaScript rich client backend,
especially with JAX-RS, the Java API for WebSocket and JSON-P
 Combining the two worlds is possible and positions applications for
deployment to mobile devices
 More options… more decisions… more technologies to evaluate
Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Public23

More Related Content

PDF
JavaCro'14 - Drools Decision tables – form of human-readable rules – Dragan J...
PDF
JavaCro'14 - Hybrid mobile apps – deploy Java web application on Android to r...
PDF
JavaCro'14 - Vaadin web application integration for Enterprise systems – Pete...
PPTX
A Designer's Intro to Oracle JET
PDF
Spring Mvc
PPTX
Best Practices for JSF, Gameduell 2013
PPT
JavaScript Frameworks and Java EE – A Great Match
PPTX
1. Spring intro IoC
 
JavaCro'14 - Drools Decision tables – form of human-readable rules – Dragan J...
JavaCro'14 - Hybrid mobile apps – deploy Java web application on Android to r...
JavaCro'14 - Vaadin web application integration for Enterprise systems – Pete...
A Designer's Intro to Oracle JET
Spring Mvc
Best Practices for JSF, Gameduell 2013
JavaScript Frameworks and Java EE – A Great Match
1. Spring intro IoC
 

What's hot (19)

PPTX
ADF Anti-Patterns: Dangerous Tutorials
PDF
Java EE 8: On the Horizon
PPTX
Essential Kit for Oracle JET Programming
PPTX
Building single page applications
PPTX
ADF Mythbusters UKOUG'14
PPTX
Oracle JET overview
PPTX
Java Technology
PPTX
Oracle JET CRUD and ADF BC REST
PPTX
Java ee introduction
PPT
Top 10 web application development frameworks 2016
PPTX
Angular jS Introduction by Google
 
PDF
JavaCro'15 - Web UI best practice integration with Java EE 7 - Peter Lehto
PDF
Jsf2 overview
PDF
Oracle JET and ADF BC REST Production Experience with Oracle Java Cloud
PPTX
PDF
Single Page Apps
PDF
Berlin.JAR: Web future without web frameworks
ODP
Java Web Programming [1/9] : Introduction to Web Application
PPTX
Extending Arquillian graphene
ADF Anti-Patterns: Dangerous Tutorials
Java EE 8: On the Horizon
Essential Kit for Oracle JET Programming
Building single page applications
ADF Mythbusters UKOUG'14
Oracle JET overview
Java Technology
Oracle JET CRUD and ADF BC REST
Java ee introduction
Top 10 web application development frameworks 2016
Angular jS Introduction by Google
 
JavaCro'15 - Web UI best practice integration with Java EE 7 - Peter Lehto
Jsf2 overview
Oracle JET and ADF BC REST Production Experience with Oracle Java Cloud
Single Page Apps
Berlin.JAR: Web future without web frameworks
Java Web Programming [1/9] : Introduction to Web Application
Extending Arquillian graphene
Ad

Viewers also liked (20)

PDF
JavaCro'14 - Pimp my Activiti – Petar Butković, Goran Pugar, Krešimir Jurasov...
PDF
Poslovna informatika 6: Podatkovne baze
PDF
JavaCro'14 - Cloud Platforms in Internet of Things – Krešimir Mišura and Bran...
PDF
JavaCro'14 - Can You Tell Me How to Get to Sesame Street I wanna be a Grails ...
PDF
JavaCro'14 - Developing Google Chromecast applications on Android – Branimir ...
PDF
JavaCro'14 - Securing web applications with Spring Security 3 – Fernando Redo...
PDF
JavaCro'14 - Log as basis for distributed systems – Vjeran Marčinko
PDF
JavaCro'14 - Packaging and installing of the JEE solution – Miroslav Rešetar
PDF
JavaCro'14 - Continuous deployment tool – Aleksandar Dostić and Emir Džaferović
PDF
JavaCro'14 - MEAN Stack – How & When – Nenad Pećanac
PDF
JavaCro'14 - Vaadin scalability myth – Gordan Ivanović
PDF
JavaCro'14 - Auditing of user activity through NoSQL database – Kristijan Duv...
PDF
JavaCro'14 - Amphinicy crown jewels our software development infrastructure –...
PDF
JavaCro'14 - Java in M2M technologies – Mango M2M software – Ivan Raguž
PDF
JavaCro'14 - Gatling – weapon in ranks of performance testing – Andrija Kranjec
PDF
PDF
JavaCro'14 - Automatized testing with Selenium 2 – Juraj Ćutić and Aleksander...
PDF
JavaCro'14 - Going Digital with Java EE - Peter Pilgrim
PDF
JavaCro'14 - Scala and Java EE 7 Development Experiences – Peter Pilgrim
PDF
JavaCro'14 - JCalc Calculations in Java with open source API – Davor Sauer
JavaCro'14 - Pimp my Activiti – Petar Butković, Goran Pugar, Krešimir Jurasov...
Poslovna informatika 6: Podatkovne baze
JavaCro'14 - Cloud Platforms in Internet of Things – Krešimir Mišura and Bran...
JavaCro'14 - Can You Tell Me How to Get to Sesame Street I wanna be a Grails ...
JavaCro'14 - Developing Google Chromecast applications on Android – Branimir ...
JavaCro'14 - Securing web applications with Spring Security 3 – Fernando Redo...
JavaCro'14 - Log as basis for distributed systems – Vjeran Marčinko
JavaCro'14 - Packaging and installing of the JEE solution – Miroslav Rešetar
JavaCro'14 - Continuous deployment tool – Aleksandar Dostić and Emir Džaferović
JavaCro'14 - MEAN Stack – How & When – Nenad Pećanac
JavaCro'14 - Vaadin scalability myth – Gordan Ivanović
JavaCro'14 - Auditing of user activity through NoSQL database – Kristijan Duv...
JavaCro'14 - Amphinicy crown jewels our software development infrastructure –...
JavaCro'14 - Java in M2M technologies – Mango M2M software – Ivan Raguž
JavaCro'14 - Gatling – weapon in ranks of performance testing – Andrija Kranjec
JavaCro'14 - Automatized testing with Selenium 2 – Juraj Ćutić and Aleksander...
JavaCro'14 - Going Digital with Java EE - Peter Pilgrim
JavaCro'14 - Scala and Java EE 7 Development Experiences – Peter Pilgrim
JavaCro'14 - JCalc Calculations in Java with open source API – Davor Sauer
Ad

Similar to JavaCro'14 - Consuming Java EE Backends in Desktop, Web, and Mobile Frontends – Geertjan Wielenga (20)

PPTX
Construindo aplicações com HTML5, WebSockets, e Java EE 7
PDF
Coding for Desktop and Mobile with HTML5 and Java EE 7
PDF
How to Thrive on REST/WebSocket-Based Microservices
PPTX
Ed presents JSF 2.2 at a 2013 Gameduell Tech talk
PDF
Server Side JavaScript on the JVM - Project Avatar - QCon London March 2014
PPT
Report From JavaOne 2009 - part 3
PDF
Aplicações HTML5 com Java EE 7 e NetBeans
PPT
Have You Seen Java EE Lately?
PDF
Project Avatar (Lyon JUG & Alpes JUG - March 2014)
PDF
Java EE 7 et ensuite pourquoi pas JavaScript sur le serveur!
PDF
Building Java Desktop Apps with JavaFX 8 and Java EE 7
PDF
Burns jsf-confess-2015
PDF
JavaONE 2012 Using Java with HTML5 and CSS3
PDF
JavaOne 2014 Java EE 8 Booth Slides
PDF
Client Server Web Apps with JavaScript and Java Rich Scalable and RESTful 1st...
PDF
Slovenian Oracle User Group
PPTX
Ed presents JSF 2.2 and WebSocket to Gameduell.
PDF
Web Application Solutions
PDF
Java EE 7 from an HTML5 Perspective, JavaLand 2015
PDF
Imworld.ro
Construindo aplicações com HTML5, WebSockets, e Java EE 7
Coding for Desktop and Mobile with HTML5 and Java EE 7
How to Thrive on REST/WebSocket-Based Microservices
Ed presents JSF 2.2 at a 2013 Gameduell Tech talk
Server Side JavaScript on the JVM - Project Avatar - QCon London March 2014
Report From JavaOne 2009 - part 3
Aplicações HTML5 com Java EE 7 e NetBeans
Have You Seen Java EE Lately?
Project Avatar (Lyon JUG & Alpes JUG - March 2014)
Java EE 7 et ensuite pourquoi pas JavaScript sur le serveur!
Building Java Desktop Apps with JavaFX 8 and Java EE 7
Burns jsf-confess-2015
JavaONE 2012 Using Java with HTML5 and CSS3
JavaOne 2014 Java EE 8 Booth Slides
Client Server Web Apps with JavaScript and Java Rich Scalable and RESTful 1st...
Slovenian Oracle User Group
Ed presents JSF 2.2 and WebSocket to Gameduell.
Web Application Solutions
Java EE 7 from an HTML5 Perspective, JavaLand 2015
Imworld.ro

More from HUJAK - Hrvatska udruga Java korisnika / Croatian Java User Association (20)

PDF
Java cro'21 the best tools for java developers in 2021 - hujak
PDF
JavaCro'21 - Java is Here To Stay - HUJAK Keynote
PDF
Javantura v7 - Behaviour Driven Development with Cucumber - Ivan Lozić
PPTX
Javantura v7 - The State of Java - Today and Tomowwow - HUJAK's Community Key...
PPTX
Javantura v7 - Learning to Scale Yourself: The Journey from Coder to Leader -...
PDF
JavaCro'19 - The State of Java and Software Development in Croatia - Communit...
PDF
Javantura v6 - Java in Croatia and HUJAK - Branko Mihaljević, Aleksander Radovan
PDF
Javantura v6 - On the Aspects of Polyglot Programming and Memory Management i...
PPTX
Javantura v6 - Case Study: Marketplace App with Java and Hyperledger Fabric -...
PDF
Javantura v6 - How to help customers report bugs accurately - Miroslav Čerkez...
PDF
Javantura v6 - When remote work really works - the secrets behind successful ...
PDF
Javantura v6 - Kotlin-Java Interop - Matej Vidaković
PDF
Javantura v6 - Spring HATEOAS hypermedia-driven web services, and clients tha...
PDF
Javantura v6 - End to End Continuous Delivery of Microservices for Kubernetes...
PPTX
Javantura v6 - Istio Service Mesh - The magic between your microservices - Ma...
PDF
Javantura v6 - How can you improve the quality of your application - Ioannis ...
PDF
Javantura v6 - Automation of web apps testing - Hrvoje Ruhek
PDF
Javantura v6 - Master the Concepts Behind the Java 10 Challenges and Eliminat...
PDF
Javantura v6 - Building IoT Middleware with Microservices - Mario Kusek
PDF
Javantura v6 - JDK 11 & JDK 12 - Dalibor Topic
Java cro'21 the best tools for java developers in 2021 - hujak
JavaCro'21 - Java is Here To Stay - HUJAK Keynote
Javantura v7 - Behaviour Driven Development with Cucumber - Ivan Lozić
Javantura v7 - The State of Java - Today and Tomowwow - HUJAK's Community Key...
Javantura v7 - Learning to Scale Yourself: The Journey from Coder to Leader -...
JavaCro'19 - The State of Java and Software Development in Croatia - Communit...
Javantura v6 - Java in Croatia and HUJAK - Branko Mihaljević, Aleksander Radovan
Javantura v6 - On the Aspects of Polyglot Programming and Memory Management i...
Javantura v6 - Case Study: Marketplace App with Java and Hyperledger Fabric -...
Javantura v6 - How to help customers report bugs accurately - Miroslav Čerkez...
Javantura v6 - When remote work really works - the secrets behind successful ...
Javantura v6 - Kotlin-Java Interop - Matej Vidaković
Javantura v6 - Spring HATEOAS hypermedia-driven web services, and clients tha...
Javantura v6 - End to End Continuous Delivery of Microservices for Kubernetes...
Javantura v6 - Istio Service Mesh - The magic between your microservices - Ma...
Javantura v6 - How can you improve the quality of your application - Ioannis ...
Javantura v6 - Automation of web apps testing - Hrvoje Ruhek
Javantura v6 - Master the Concepts Behind the Java 10 Challenges and Eliminat...
Javantura v6 - Building IoT Middleware with Microservices - Mario Kusek
Javantura v6 - JDK 11 & JDK 12 - Dalibor Topic

Recently uploaded (20)

PDF
Machine learning based COVID-19 study performance prediction
PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
PDF
The Rise and Fall of 3GPP – Time for a Sabbatical?
PDF
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
DOCX
The AUB Centre for AI in Media Proposal.docx
PDF
Building Integrated photovoltaic BIPV_UPV.pdf
PDF
Encapsulation theory and applications.pdf
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
PDF
Chapter 3 Spatial Domain Image Processing.pdf
PPTX
MYSQL Presentation for SQL database connectivity
PDF
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
PDF
MIND Revenue Release Quarter 2 2025 Press Release
PDF
gpt5_lecture_notes_comprehensive_20250812015547.pdf
PDF
Spectral efficient network and resource selection model in 5G networks
PPT
“AI and Expert System Decision Support & Business Intelligence Systems”
PPTX
A Presentation on Artificial Intelligence
PDF
NewMind AI Weekly Chronicles - August'25-Week II
PDF
Reach Out and Touch Someone: Haptics and Empathic Computing
PDF
A comparative analysis of optical character recognition models for extracting...
PDF
Per capita expenditure prediction using model stacking based on satellite ima...
Machine learning based COVID-19 study performance prediction
Agricultural_Statistics_at_a_Glance_2022_0.pdf
The Rise and Fall of 3GPP – Time for a Sabbatical?
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
The AUB Centre for AI in Media Proposal.docx
Building Integrated photovoltaic BIPV_UPV.pdf
Encapsulation theory and applications.pdf
Advanced methodologies resolving dimensionality complications for autism neur...
Chapter 3 Spatial Domain Image Processing.pdf
MYSQL Presentation for SQL database connectivity
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
MIND Revenue Release Quarter 2 2025 Press Release
gpt5_lecture_notes_comprehensive_20250812015547.pdf
Spectral efficient network and resource selection model in 5G networks
“AI and Expert System Decision Support & Business Intelligence Systems”
A Presentation on Artificial Intelligence
NewMind AI Weekly Chronicles - August'25-Week II
Reach Out and Touch Someone: Haptics and Empathic Computing
A comparative analysis of optical character recognition models for extracting...
Per capita expenditure prediction using model stacking based on satellite ima...

JavaCro'14 - Consuming Java EE Backends in Desktop, Web, and Mobile Frontends – Geertjan Wielenga

  • 1. Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Public1 Consuming Java EE in Desktop, Web, and Mobile Frontends Geertjan Wielenga Oracle Developer Tools [email protected] @geertjanw
  • 2. Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Public2 Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Public Agenda  JavaScript/HTML5 Rich Client Landscape  Java EE 7  Java EE + JavaScript  Tools and Technologies  Demos
  • 3. Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Public3 JavaScript/HTML5 Rich Clients Landscape  The thin client vs. rich client debate is pretty old… » Thin Client - All processing on server - Round tripping to server - Delays… » Thin Client Rich Client » - Complex, dynamic » - Feature-rich UI » - Access local resources
  • 4. Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Public4 JavaScript/HTML5 Rich Clients Landscape  Server side frameworks have ruled for a while – Everything on the server  Spring / Hibernate  JSF  Struts  Tapestry  AJAX is a mild shift to the client, “best of both worlds approach” – Asynchronous partial page refresh solutions  PrimeFaces  Wicket  GWT  Vaadin
  • 5. Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Public5 Demo: PrimeFaces, Java EE, and Maven
  • 6. Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Public6 JavaScript/HTML5 Rich Clients Landscape
  • 7. Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Public7 JavaScript/HTML5 Rich Clients Landscape  Rich clients powered by JS/HTML appear to be making a comeback – Improving JavaScript engines  V8  *Monkey  Nashorn – Better tools  jQuery  MV* Frameworks  Chrome, FireFox – Standards advancement  CSS3  HTML5  WebSocket
  • 8. Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Public8 Perhaps Not A Slam Dunk?  Richer clients clearly better at some things – Highly dynamic, interactive interfaces – Complex, feature-rich UIs – “Single page applications” (“Applets” )  But perhaps not a panacea – Heavily form/workflow driven applications – Server-side rendering still a better bet for performance/reliability? – JavaScript/HTML development is not without it’s pains… – Server-side frameworks are a strong incumbent  Co-existence in the short and long term? – Islands of rich client functionality within server-centric UIs? – Different strokes for different folks?
  • 9. Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Public9 My Big Fat Rich-Client Architecture  Very similar to client/server architecture of lore – Client responsible for UI rendering, basic input validation, logic and state – Server responsible for business logic, domain model, persistence – Web/HTTP is glue that connects client and server  Typical communication protocols – REST for majority of cases – WebSocket when full-duplex communication is needed – JavaScript tools support REST well, but not WebSocket (yet)  The typical (ideal?) data interchange format is JSON  Java EE is a great server-side platform for this architecture…
  • 10. Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Public10 Java EE + JavaScript EJB 3 Servlet CDI JPA JAX-RS BeanValidation Java API for WebSocket Java API for JSON JMS JTA JavaScript/HTML5 JAXB JCA
  • 11. Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Public11 JAX-RS  REST development API for Java  Server and client  Annotation based, declarative – @Path, @GET, @POST, @PUT, @DELETE, @PathParam, @QueryParam, @Produces, @Consumes  Pluggable and extensible – Providers, filters, interceptors
  • 12. Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Public12 JAX-RS Example @Path("/atm/{cardId}") public class AtmService { @GET @Path("/balance") @Produces("text/plain") public String balance( @PathParam("cardId") String card, @QueryParam("pin") String pin) { return Double.toString(getBalance(card, pin)); } ...
  • 13. Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Public13 Java API for WebSocket  High level declarative API for WebSocket  Both client and server-side  Small, powerful API – @ServerEndpoint, @OnOpen, @OnClose, @OnMessage, @OnError, Session, Remote  Pluggable and extensible – Encoders, decoders, sub-protocols
  • 14. Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Public14 WebSocket Example @ServerEndpoint("/chat") public class ChatBean { Set<Session> peers = Collections.synchronizedSet(…); @OnOpen public void onOpen(Session peer) { peers.add(peer); } @OnClose public void onClose(Session peer) { peers.remove(peer); } ...
  • 15. Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Public15 JavaScript Movers and Shakers
  • 16. Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Public16 Demo: Backbone.js, Java EE, and Maven
  • 17. Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Public17 Demo: Angular.js
  • 18. Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Public18 Useful New Tools and Technologies
  • 19. Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Public19 Useful New Tools and Technologies  Post Processors – Emmet – SASS/LESS – CoffeeScript  Cordova/PhoneGap  HTML5 Ecosystem – Grunt – Karma – Bower – Yeoman
  • 20. Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Public20 Demo: SASS, LESS, Karma, Cordova
  • 21. Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Public21 But Browser/Phone Is Not For Everyone…
  • 22. Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Public22 Summary  JavaScript/HTML5 clients gaining traction as opposed to server-side web frameworks  Communication between the client and server happens via JSON over REST or WebSocket  Java EE well positioned as a JavaScript rich client backend, especially with JAX-RS, the Java API for WebSocket and JSON-P  Combining the two worlds is possible and positions applications for deployment to mobile devices  More options… more decisions… more technologies to evaluate
  • 23. Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Public23