Ajax was apparently one of the hottest topic in JavaOne 2006.
I felt strange that most of the speakers identified Web 2.0
with AJax. Anyway, the conference shed light on some interesting
frameworks to generate Javascript code, such as Dojo, GWT, etc.
Back from the conference, I did a trouble-shooting of a
financial application implemented as a Java applet.
Some problems were related to JVM crash on Windows 98.
Java5 printing was also problematic. We had to recommend the
customer to implement printing on server side, so that
JVM is less likely to crash on various kinds of PCs.
The UI is implemented with Swing and Nexaweb, which all could
be rewritten with DHTML/Ajax, though we didn't suggest that.
During the trouble shooting, I was wondering if the DHTML/AJax
could be written in Java, with a small modification to Java-plugin,
because Java has some advantages over JavaScript.
Can access local resources
Java allows you to provide relaxed security restriction under Java2 security.
Better modularity
Why every web apps has to download prototype.js or similar libraries for every request?
Bytecode is more efficient as mobile code
Receiving scripts means that the interpreter has to parse the program every time, which is not efficient.
Java applet is notorious for its slow startup. But if it has no Swing/AWT, I am hoping that the recent development of code sharing would shorten the startup time down to .2 second or even less.
Java plugin has ActiveX-bridge in it, which is usually not visible from application programmers. But if you allow AllPermission to the applet, the ActiveX-bridge can be used directly. So, I did some experiment on that.
1. Put ${user.home}/.java.policy
grant {
permission java.security.AllPermission;
};
2. Modified pnuts.tools.PnutsConsoleApplet so that the Applet instance is stored in a context local variable.
The script above may look ugly, but getMember/setMember(), and call() could be simplified with a configuration. What is really needed is a way to define event handler written in Java. I have no idea so far if it is possible without modification to IE.