• Embed Doc
  • Readcast
  • Collections
  • 1
    CommentGo Back
Download
 
© 2009 Marty Hall
The Goole Web Toolkit GWT:JavaScript Native Interface (JSNI)
(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
Calling JavaScript from Java
Format of methodsThe $wndand $doc variables 
Calling Java from JavaScript
 Designating overloaded methodsArgument types
Example
Using Scriptaculous effects
JavaScript Overlay types
Example: Circle class
5
© 2009 Marty Hall
Overview
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.
 
Idea
Write Java methods that call JavaScript
ncose avacrp coe n commens
Use $wndvariable to access window objectUse $doc variable to access document object
, ,
Overlay types
You can wrap JSON objects in Java classes
avacrp coe can ca ava
Use JNI-like format to refer to methods and fields
Notes
JSNI can be used only for pure client-side code
Method bodies ignored when used in server-side classes
JSNI should be used sarinl
Most normal JavaScript functionality available in GWTMostly used to wrap external JavaScript libraries or to processnon-RPC return values
7
© 2009 Marty Hall
 Java
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.
of 00

Leave a Comment

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