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