Monthly Archives: October 2006

About Soheil Hassas Yeganeh

Soheil Hassas Yeganeh, an Iranian developer, who lives Tehran, is a contributor to java2script project. He has many experiences using java and j2ee and also some hard core FreeBSD and Linux kernel projects. He is now a Software Eng. PhD student in Sharif University of Technology. He got his BS in SE and MS in AI from Sharif University of Technology.

Posted in Uncategorized | 1 Comment

Extending Java2Script Compiler

Now, the java 2 javascript compiler of the java2script can be extended. There is a tutorial for demonstrating the extension mechanism.
This extension mechanism can be used to override default behavior of java2script compiler. So, why do we need to override the default behavior of the java2script compiler? Let’s have a simple example. Suppose an application that uses a library that can not be converted to java script, an ejb invocation:

EJBX x = EJBUtil.newInstance(EJBX.class, jndiName);

x.methodA();

Now if we use the default java2script compiler the code would be something like:

var x = foo.bar.EJBUtil.newInstance(….);

x.methodA();

But, we now that this will not work. It seems to be unsolvable before the extension mechanism is introduced. But now the java2script compiler can be extended to convert such these codes to another java script code that does work on a browser and also does not use the library.
Now if we extend the java2script compiler we can generate a stub invocation like this, that sould work without any ejb import or invocation:

ServletFacade.runEJBMethod(“foo.bar.EJBX”, “methodA”, jndiName);
//And the ServletFacade could be an stub for calling a servlet that can run EJBs

So, with this mechanism, one can convert any source code in his own way.

Posted in AJAX, Java2Script News, JavaScript | Leave a comment

ColorDialog and FontDialog

Now comes JavaScript version of SWT ColorDialog and FontDialog:

J2S SWT Color Dialog

J2S SWT Font Dialog

Posted in Java2Script News, Screenshot, Sharing | 2 Comments

Java2Script Introduces Simple RPC

Java2Script now introduces Simple RPC, which is aiming to help Java
developers balancing and debugging *local* and *remote* procedure calls for AJAX RIAs without knowledge of serialization and deserialization.

In Simple RPC, Java client have two modes: AJAX mode and local Java Thread mode (Default mode).
Here are some simple words describing the procedure of developing AJAX RIAs with Simple RPC.

1. Java developer can debug those procedure calls in local Java Thread mode with local Java SWT client.

2. After functions implemented, they can add a Java servlet wrapper (Java2Script provided), export all things as a JAR file and deploy it to Java EE container.

3. And now switch Java client to AJAX mode (set some static variables) and test whether the deployed servlet is OK or not.

4. If not correctly deployed or bugs popup, developers can switch back to local Java
Thread mode and do their debugging again.

5. In the end, use Java2Script compiler to compiler the Java SWT client into JavaScript RIA client and test it in browser.

For more details, please check out latest codes from SVN.

Posted in AJAX, How To, Java, Java2Script News, RPC, Simple RPC | 2 Comments

Java2Script M4 Delay to November

I am sorry for saying Java2Script M4 is delayed to November.

And considering M4 will be the final milestone with features frozen and the current works has not worked out all features scheduled, M4 will be put off to early November.

BTW: Use SVN to keep update with latest Java2Script. Or join Java2Script team contributing your efforts in implementations, tests or documents.

Posted in Java2Script News | Leave a comment

Java-JavaScript Compiler Discussion

Ash mentioned Java2Script in the thread of “Java-JavaScript Compiler” in GWT’s group forum. And I joined in the discussion. I was not intended to post another GWT v.s. JavaScript post there (But it seems it was a v.s. thing actually). I just wanted to share things, correct my understanding and learn new things.

In those discussion, Bruce from Google told us that GWT’s motivation is “to be as small and as efficient as possible” and its two separate goals are:
(1) Create highly optimized JS output
(2) Optionally, publish selected parts of your code with a JS-compatible API
I thought that wais a very clever design. And I admired GWT team for its “excellent 100k ~ 200k final *.js files with very good performance”.
OK, if you are interested in Java to JavaScript technology, just go to GWT’s forum and ask GWT team for more details.

By the way, it seems that Java2Script website provides no detailed documents about Java to JavaScript compiler technology. I posted some details there in the discussion. Just check it out there. Or you can check sources from SVN for more details.

Posted in Java, JavaScript, Sharing | Leave a comment