Javafx Rich Internet Applications With Restful Web Services, Jersey Api and Json
Javafx Rich Internet Applications With Restful Web Services, Jersey Api and Json
Sébastien Stormacq
Senior Software Architect, Sun Microsystems Belgium & Luxembourg
Learn how to architect and build
JavaFX RIA application with asynchronous
communication to REST and JSON based
web services.
- or -
How to place maximum numbers of buzz words and acronyms in a
presentation title.
JavaFX REST
Client RIA Web Service
http / json jdbc
GlassFish v3
scene: Scene {
content: Text {
value: "Hello JavaFX World"
}
}
}
* Comparison is based on Java SE 1.6 and is totally not objective. XML classes include full support for schema, cryptography, web services
and much more other functionalities not offered by JSON parsers
2009 CommunityOne Conference: North | no.sun.com/communityone 15
Agenda
Architecture Overview
JavaFX in a nutshell
REST based Web Services
JSON
Put it all together
REST
Web Service
http / json
GlassFish v3
@GET
@Produces("application/json")
public String getValues() {
String result;
try {
result = ...
} catch (JSONException e) {
...
}
return result;
}
}
scene: Scene {
content: PieChart {
data: [ ... ]
}
}
}
Reusing JavaFX 1.2 PieChart component
Alternative : Open Source PieChartFX + online
tutorial to build it from scratch
• http://blogs.sun.com/sebsto
2009 CommunityOne Conference: North | no.sun.com/communityone 20
Putting it all Together
An Asynchronous Communication
var request : HttpRequest = HttpRequest {
location: "...";
//parsing code
}
}
Sébastien Stormacq
sebastien.stormacq@sun.com
http://blogs.sun.com/sebsto http://www.twitter.com/sebsto