web applications of the future: combining jee6 & javafx
DESCRIPTION
This presentation shows the most important web related new futures in JEE 6, and how to combine JEE 6 and JavaFX to create interesting applications. Topics such as JAX-RS, JSF 2.0, EJB lite and JavaFX/JavaScript integration is discussed.TRANSCRIPT
![Page 1: Web Applications of the future: Combining JEE6 & JavaFX](https://reader034.vdocument.in/reader034/viewer/2022051513/545c52e1b0af9fa92c8b4711/html5/thumbnails/1.jpg)
Developing Web Applications of the future
-Combining JEE 6 & JavaFX
![Page 2: Web Applications of the future: Combining JEE6 & JavaFX](https://reader034.vdocument.in/reader034/viewer/2022051513/545c52e1b0af9fa92c8b4711/html5/thumbnails/2.jpg)
Goal of this talk
New features in JEE 6Mixing JEE 6 and JavaFXA look into the near future
![Page 3: Web Applications of the future: Combining JEE6 & JavaFX](https://reader034.vdocument.in/reader034/viewer/2022051513/545c52e1b0af9fa92c8b4711/html5/thumbnails/3.jpg)
About me
Paul Bakker Trainer Info Support NLJUG speaker Java Magazine author
EJB 3JSFSeamJavaFXSpringHibernateFlex
![Page 4: Web Applications of the future: Combining JEE6 & JavaFX](https://reader034.vdocument.in/reader034/viewer/2022051513/545c52e1b0af9fa92c8b4711/html5/thumbnails/4.jpg)
Outline
JavaFX web applicationsJAX-RS RESTful servicesConnecting JavaFX to services
Outline
![Page 5: Web Applications of the future: Combining JEE6 & JavaFX](https://reader034.vdocument.in/reader034/viewer/2022051513/545c52e1b0af9fa92c8b4711/html5/thumbnails/5.jpg)
One minute JavaFX intro
Sun’s RIA platformCompetes with Flex, Flash and Silverlight
A new languageJavaFX ScriptDeclarative UI programming
![Page 6: Web Applications of the future: Combining JEE6 & JavaFX](https://reader034.vdocument.in/reader034/viewer/2022051513/545c52e1b0af9fa92c8b4711/html5/thumbnails/6.jpg)
JavaFX key features
ExpressivenessEasy component creationAnimationJava integrationMedia supportWrite once, run anywhere...
![Page 7: Web Applications of the future: Combining JEE6 & JavaFX](https://reader034.vdocument.in/reader034/viewer/2022051513/545c52e1b0af9fa92c8b4711/html5/thumbnails/7.jpg)
Current problems
No components!No layout managersNo selectable textTooling
![Page 8: Web Applications of the future: Combining JEE6 & JavaFX](https://reader034.vdocument.in/reader034/viewer/2022051513/545c52e1b0af9fa92c8b4711/html5/thumbnails/8.jpg)
ProfilesEJB 3.0 => 3.1 (Lite)JSF 1.2 => 2.0JPA 1.0 => 2.0JAX-RS => New!WebBeans => New!
JEE 6 ingredients
![Page 9: Web Applications of the future: Combining JEE6 & JavaFX](https://reader034.vdocument.in/reader034/viewer/2022051513/545c52e1b0af9fa92c8b4711/html5/thumbnails/9.jpg)
Using JEE 6
GlassFish V3EJB3.1, JSF 2.0 and JAX-RSNo WebBeans, Servlet 3.0 and JPA 2.0 yetOnly WAR deplyment
![Page 10: Web Applications of the future: Combining JEE6 & JavaFX](https://reader034.vdocument.in/reader034/viewer/2022051513/545c52e1b0af9fa92c8b4711/html5/thumbnails/10.jpg)
JavaFX HTMLJavaScript
JAX-RS JSF
EJB 3
JPA
HTTP
JEE 6 & JavaFXBrowser
Server
Desktop
JavaFX
![Page 11: Web Applications of the future: Combining JEE6 & JavaFX](https://reader034.vdocument.in/reader034/viewer/2022051513/545c52e1b0af9fa92c8b4711/html5/thumbnails/11.jpg)
FaceletsAnnotation support
e.g. @ManagedBeanAJAX supportResource loadingProject Stages
2.0 highlightsJSF
![Page 12: Web Applications of the future: Combining JEE6 & JavaFX](https://reader034.vdocument.in/reader034/viewer/2022051513/545c52e1b0af9fa92c8b4711/html5/thumbnails/12.jpg)
Integrating JSF & JavaFX
JSF renders to HTMLUse <applet> tagJavaScript for communication
All text oriented functionality => JSFAll flashy stuff => JavaFX
![Page 13: Web Applications of the future: Combining JEE6 & JavaFX](https://reader034.vdocument.in/reader034/viewer/2022051513/545c52e1b0af9fa92c8b4711/html5/thumbnails/13.jpg)
Full page JavaFX
Too limited at this momentNavigation, bookmarks, scrolling...
Will be an option in future versionsOk for Swing / Desktop
![Page 14: Web Applications of the future: Combining JEE6 & JavaFX](https://reader034.vdocument.in/reader034/viewer/2022051513/545c52e1b0af9fa92c8b4711/html5/thumbnails/14.jpg)
JavaFX brower integration
AppletStageExtension Browser navigationScript evaluation
Call JavaScript methods
![Page 15: Web Applications of the future: Combining JEE6 & JavaFX](https://reader034.vdocument.in/reader034/viewer/2022051513/545c52e1b0af9fa92c8b4711/html5/thumbnails/15.jpg)
JavaFX calling JavaScript
![Page 16: Web Applications of the future: Combining JEE6 & JavaFX](https://reader034.vdocument.in/reader034/viewer/2022051513/545c52e1b0af9fa92c8b4711/html5/thumbnails/16.jpg)
Server url
JavaFX uses web services to connect to the serverDo not hardcode the server urlUse FX.getParameter
![Page 17: Web Applications of the future: Combining JEE6 & JavaFX](https://reader034.vdocument.in/reader034/viewer/2022051513/545c52e1b0af9fa92c8b4711/html5/thumbnails/17.jpg)
JSF page initialization
Use @ManagedProperty to inject a request parameter
Use @PostConstruct to initialize values
![Page 18: Web Applications of the future: Combining JEE6 & JavaFX](https://reader034.vdocument.in/reader034/viewer/2022051513/545c52e1b0af9fa92c8b4711/html5/thumbnails/18.jpg)
JFXtras
Layout Managers MigLayout port
CompontentsDialogsUnit Testing
http://code.google.com/p/jfxtras/
![Page 19: Web Applications of the future: Combining JEE6 & JavaFX](https://reader034.vdocument.in/reader034/viewer/2022051513/545c52e1b0af9fa92c8b4711/html5/thumbnails/19.jpg)
MigLayout example
![Page 20: Web Applications of the future: Combining JEE6 & JavaFX](https://reader034.vdocument.in/reader034/viewer/2022051513/545c52e1b0af9fa92c8b4711/html5/thumbnails/20.jpg)
JavaFX HTMLJavaScript
JAX-RS JSF
EJB 3
JPA
HTTP
JEE 6 & JavaFXBrowser
Server
Desktop
JavaFX
![Page 21: Web Applications of the future: Combining JEE6 & JavaFX](https://reader034.vdocument.in/reader034/viewer/2022051513/545c52e1b0af9fa92c8b4711/html5/thumbnails/21.jpg)
Expose RESTful web servicesAnnotation basedEasily combined with EJB and JPA
But no @EJB injection (yet)
JAX-RS
![Page 22: Web Applications of the future: Combining JEE6 & JavaFX](https://reader034.vdocument.in/reader034/viewer/2022051513/545c52e1b0af9fa92c8b4711/html5/thumbnails/22.jpg)
RESTful intro
Web style web servicesResources over HTTP
Uniform Interface
Addressability
Connectedness
Statelessness
![Page 23: Web Applications of the future: Combining JEE6 & JavaFX](https://reader034.vdocument.in/reader034/viewer/2022051513/545c52e1b0af9fa92c8b4711/html5/thumbnails/23.jpg)
@PathResource class root pathA sub-resource
JAX-RS
![Page 24: Web Applications of the future: Combining JEE6 & JavaFX](https://reader034.vdocument.in/reader034/viewer/2022051513/545c52e1b0af9fa92c8b4711/html5/thumbnails/24.jpg)
@GETMethod handling GET requests
@ProducesContent type supported
@PathParamExtract value from URI template
JAX-RS
![Page 25: Web Applications of the future: Combining JEE6 & JavaFX](https://reader034.vdocument.in/reader034/viewer/2022051513/545c52e1b0af9fa92c8b4711/html5/thumbnails/25.jpg)
Using JPA
Use out-of-container JPA confgurationUse EJB (Lite) Session Beans Lookup
Global JNDI namespace@EJB
Use Session Bean as resourceMight not be in JEE 6
![Page 26: Web Applications of the future: Combining JEE6 & JavaFX](https://reader034.vdocument.in/reader034/viewer/2022051513/545c52e1b0af9fa92c8b4711/html5/thumbnails/26.jpg)
JavaFX HTMLJavaScript
JAX-RS JSF
EJB 3
JPA
HTTP
JEE 6 & JavaFXBrowser
Server
Desktop
JavaFX
![Page 27: Web Applications of the future: Combining JEE6 & JavaFX](https://reader034.vdocument.in/reader034/viewer/2022051513/545c52e1b0af9fa92c8b4711/html5/thumbnails/27.jpg)
lite
No interface requiredRuns in the web profileNo Message Driven BeansNo remote interfaceNo Timer serviceNo EJB 2.x compatibility
EJB 3
![Page 28: Web Applications of the future: Combining JEE6 & JavaFX](https://reader034.vdocument.in/reader034/viewer/2022051513/545c52e1b0af9fa92c8b4711/html5/thumbnails/28.jpg)
EJB 3.1 lite Session Bean
![Page 29: Web Applications of the future: Combining JEE6 & JavaFX](https://reader034.vdocument.in/reader034/viewer/2022051513/545c52e1b0af9fa92c8b4711/html5/thumbnails/29.jpg)
Global JNDI namespace
A portable namespace
java:global[/<app-name>]/<module-name>/<bean-name>
![Page 30: Web Applications of the future: Combining JEE6 & JavaFX](https://reader034.vdocument.in/reader034/viewer/2022051513/545c52e1b0af9fa92c8b4711/html5/thumbnails/30.jpg)
Using Global JNDI
MobileShopServices.war
![Page 31: Web Applications of the future: Combining JEE6 & JavaFX](https://reader034.vdocument.in/reader034/viewer/2022051513/545c52e1b0af9fa92c8b4711/html5/thumbnails/31.jpg)
Converting
JAXB
Resource Entity
ConverterXML
Request
Response
![Page 32: Web Applications of the future: Combining JEE6 & JavaFX](https://reader034.vdocument.in/reader034/viewer/2022051513/545c52e1b0af9fa92c8b4711/html5/thumbnails/32.jpg)
Converting Entities
Each Entity has two convertersA single Entity converterA list converter
A JAXB annotated wrapper class
![Page 33: Web Applications of the future: Combining JEE6 & JavaFX](https://reader034.vdocument.in/reader034/viewer/2022051513/545c52e1b0af9fa92c8b4711/html5/thumbnails/33.jpg)
Converter example
![Page 34: Web Applications of the future: Combining JEE6 & JavaFX](https://reader034.vdocument.in/reader034/viewer/2022051513/545c52e1b0af9fa92c8b4711/html5/thumbnails/34.jpg)
JavaFX web service API
JavaFX style HTTP callsPull style parsing
XML and JSON supportedREST only (no SOAP)
![Page 35: Web Applications of the future: Combining JEE6 & JavaFX](https://reader034.vdocument.in/reader034/viewer/2022051513/545c52e1b0af9fa92c8b4711/html5/thumbnails/35.jpg)
![Page 36: Web Applications of the future: Combining JEE6 & JavaFX](https://reader034.vdocument.in/reader034/viewer/2022051513/545c52e1b0af9fa92c8b4711/html5/thumbnails/36.jpg)
JavaFX Production Suite
Designer => Developer
Workflow
![Page 37: Web Applications of the future: Combining JEE6 & JavaFX](https://reader034.vdocument.in/reader034/viewer/2022051513/545c52e1b0af9fa92c8b4711/html5/thumbnails/37.jpg)
Production SuiteWorkflow
PhotoshopPlace all
elements on scene
Add action handlers
Add animation
Replace dummy
elements
![Page 38: Web Applications of the future: Combining JEE6 & JavaFX](https://reader034.vdocument.in/reader034/viewer/2022051513/545c52e1b0af9fa92c8b4711/html5/thumbnails/38.jpg)
More about this
June 29: Summer ClassBert Ertman & Paul Bakker
![Page 39: Web Applications of the future: Combining JEE6 & JavaFX](https://reader034.vdocument.in/reader034/viewer/2022051513/545c52e1b0af9fa92c8b4711/html5/thumbnails/39.jpg)
More about this
June 29: Summer ClassJSF 2.0Servlet 3.0EJB 3.1 (lite)JPA 2.0WebBeansJAX-RSJavaFX (including new beta)