1 / 9

Your new desktop: Web 2.0

Your new desktop: Web 2.0. Google Web Toolkit server side java libraries that emit javascript and html. Google Desktop Gadgets. Gmail. GWT. An open source Java software development framework. Front-end (client) code is written in Java and compiled to JavaScript and HTML.

everly
Download Presentation

Your new desktop: Web 2.0

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Your new desktop: Web 2.0 Google Web Toolkitserver side java libraries that emit javascript and html

  2. Google Desktop Gadgets

  3. Gmail

  4. GWT • An open source Java software development framework. • Front-end (client) code is written in Java and compiled to JavaScript and HTML. • Back-end (server) Java code is compiled to servlets. JavaScript Client Java Code GWT Compiler HTML Server Java Code Java Compiler Java Servlet

  5. Example

  6. Dynamic UI Support • com.google.gwt.user.client.ui • Source code: similar to Swing and SWT • DOM, dynamic HTML will be manipulated through JavaScript generated from GWT Java code • class com.google.gwt.user.client.ui.FlexTable setText(0, 0, “Amelie”) <table> <tr> <td>Amelie</td> … </tr> … </table>

  7. Remote Procedure Call public interface MovieService extends RemoteService { Movie[] getMovies(int start, int count); Movie getMovie(String id); } public interface MovieServiceAsync { void getMovies(int start, int count, AsyncCallback callback); void getMovie(String id, AsyncCallback callback); } Client side Server side Calls MovieServiceAsync RPC MovieList MovieServiceImp MovieService Implements

  8. Two modes • Hosted mode • Client side: Google hosted browser – interprets Java code • Server side: embedded Tomcat Server – Servlet classes (uses Java compiler) • Web mode • Client side: web browser (i.e., Firefox) – JavaScript and HTML (uses Java2JS compiler) • Server side: Tomcat Server – Servlet classes (uses Java compiler)

  9. Using Servlet Objects class com.google.gwt.user.server.rpc.RemoteServiceServlet { protected final HttpServletRequest getThreadLocalRequest() protected final HttpServletResponse getThreadLocalResponse() } e.g. using Servlet Session Objects HttpServletRequest request = getThreadLocalRequest(); HttpSession session = request.getSession();

More Related