J2Page: Comparison With Other Java-to-JavaScript Converters
J2Page is certainly not the only tool that take the Java-to-JavaScript conversion route. This
page lists other such tools of which we are aware:
-
Google Web Toolkit The most famous of these tools
is undoubtably the Google Web Toolkit (GWT for short). Read about
the main differences between J2Page and GWT here.
-
Java2Script (aka J2S). From the project site "Java2Script (J2S) Pacemaker provides an Eclipse Java to JavaScript compiler plugin and an implementation of JavaScript version of Eclipse Standard Widget Toolkit (SWT) with other common utilities, such as java.lang.* and java.util.*. You can convert your SWT-base Rich Client Platform (RCP) into Rich Internet Application (RIA) by Java2Script Pacemaker."
Thus the emphasis of J2S is to bring Eclipse's SWT to the web via JavaScript, which contrasts with the J2Page approach of simply "wrapping" existing JavaScript widget libraries. This difference has a few ramifications:
-
With J2S the standard API you are working with is Eclipe's SWT (Standard Widget Toolkit) while with J2Page the API is the browsers' standard DOM at the lowest level, or, at a higher level, your choice of existing JavaScript libraries.
-
Applications written in J2S can be run both on the desktop (via SWT) or on the web. J2Page is intended to solely build web applications (although desktop-like functionality can be achieved via rich widget sets and offline storage).
-
J2S handles the communication between browser and server under the hood in it's own fashion. With J2Page by contrast the developer controls the client-server communication and can choose the appropriate mechanism (DWR, JSON, SOAP, etc.)
-
Despite these differences, there certainly is opportunities for code-sharing between the two projects, especially when it comes to building JavaScript equivalents to the Java standard libraries. We will be looking into such code sharing possibilities in the near-term future.
-
Do you know of any other tools that convert Java to JavaScript? Please let us know.
|