• Embed Doc
  • Readcast
  • Collections
  • CommentGo Back
Download
 
© 2009 Marty Hall
 
Using GWT RPC to Access Server-Side Data
(GWT 1.6 Version)
Originals of Slides and Source Code for Examples:http://courses.coreservlets.com/Course-Materials/ajax.html
Customized Java EE Training: http://courses.coreservlets.com/ 
Servlets, JSP, Struts, JSF/MyFaces/Facelets, Ajax, GWT, Spring, Hibernate/JPA, Java 5 & 6.Developed and taught by well-known author and developer. At public venues or onsite at
 your 
location.
© 2009 Marty Hall
For live Ajax & GWT training, see trainingcourses a p:courses.coreserves.com.
Taught by the author of 
Core Servlets and JSP 
,
More 
, .venues, or customized versions can be held on-siteat yourorganization.
 
Customized Java EE Training: http://courses.coreservlets.com/ 
Servlets, JSP, Struts, JSF/MyFaces/Facelets, Ajax, GWT, Spring, Hibernate/JPA, Java 5 & 6.Developed and taught by well-known author and developer. At public venues or onsite at
 your 
location.
 
Courses developed and taught by Marty Hall
 – Java 5, Java 6, intermediate/beginning servlets/JSP, advanced servlets/JSP, Struts, JSF, Ajax, GWT, custom mix of topics
Courses developed and taught by coreservlets.com experts (edited by Marty)
 – Spring, Hibernate, EJB3, Ruby/Rails
Contacthallcoreservlets.comfordetails
 
Topics in This Section
Idea of RPC
eveopment process
Defining main data service interfaceDefining callback version of data service interface
 
Making a data service servletCreating a service proxy-
Examples
Getting simple data from serverGetting complex types from serverGetting serializablecustom classes from server
Handlin asnchronous methods
Performing server-dependent ops only in callback methods
Testing
5
RPC: Big Idea
Write regular methods on server;don’t write servlet methods
Methods take arbitrary arguments
 
Methods return arbitrary results
Strings, arrays, lists, custom classes, etc.
Call methods directly from client;don’t make explicit HTTP requests
a server metos amost as toug tey were ocaPass arbitrary arguments and get arbitrary results
Custom form of serialization handles all the arsin
6
 
RPC: Notes
Online RPC documentation is good
Start at http://code.google.com/webtoolkit/overview.html,go to “Developer’s Guide” and then “CommunicatingwithaServer”. 
 
GWT does not require RPC
It is a tremendous simplification, and should be used for
 
all new GWT projects. However, if you
already
have aserver-side resource, you can still access it. See...clientserver.html
However, this approach is muchlower-level, and it. .
7
RPC Data Types
Server methods can accept & return complex types
Pacing and unpacing handled automatically
Even though client-side code is JavaScript (not Java) at runtime
Legal types
Primitives
int, double, boolean, etc.
Wraers
Integer, Double, Boolean, etc.
A subset of standard Java types
ArraListDateHashMaHashSetStrinetc. 
 – For full list, go to main GWT page athttp://code.google.com/webtoolkit/overview.html, then Reference Guide,then JRE Emulation Reference. No String.formator printf.
 Arrays containing any of the above types
8
of 00

Leave a Comment

You must be to leave a comment.
Submit
Characters: ...
You must be to leave a comment.
Submit
Characters: ...