 |
Applet-JAX
Posted by chet on November 07, 2006 at 05:12 PM | Comments (11)
Go to the Yapplet Demo
Historically, Java applet development has been somewhat of an exclusive game;
you either use Java or you use some other technology.
In the AJAX world, this has led to either Java or a mix of
other technologies.
But there is no reason why Java cannot be a player in this world. Clearly,
HTML is pretty good at doing text stuff, the DOM is handy for manipulating
elements on the page, and JavaScript is a handy way to get at the DOM
elements. But Java has some unique capabilities, too (including
performance, development tools and platforms, robust language and library
features, yadda yadda yadda). So how can we mix these worlds better, so
that Java can be another tool in the web application toolbox?
Enter Applet-JAX (Hans Muller's awesome name for this approach); we explore some
of the existing infrastructure that allows Java-JavaScript communication to
work and thus allows Java to be yet another player in an AJAX application.
There are a host of ideas and possibilities here, but we'll start out
pretty simple; go to the Yapplet Demo page to read about and run an applet demo that
shows off some of what I'm talking about.
Bookmark blog post: del.icio.us Digg DZone Furl Reddit
Comments
Comments are listed in date ascending order (oldest first) | Post Comment
-
I get a lot of these when showing / hiding the applet:
Problem calling js function setAppletHeight with params [Ljava.lang.String;@1b8fdf2:netscape.javascript.JSException: Native DOM Object has been released
This is in Firefox 2.0
Posted by: kirillcool on November 07, 2006 at 05:23 PM
-
Doesn't work so well on Opera under Solaris. It doesn't animate. First time it went white after switching tabs. Then it locked up my browser twice.
I tried manipulating the DOM of the web page the other week (see my weblog). However, a lot of the API isn't implemented and that which is implemented is flakey in the extreme. (The implementation uses JSObject to call the JavaScript equivalent.)
Posted by: tackline on November 08, 2006 at 04:08 AM
-
interesting! I also wrote some blog to use DOM API to display/hide webpage from applet. see http://blog.sina.com.cn/u/4ad4a32e010005sb.
It's in Chinese. However, it's enough to see the code only.
Posted by: qinwangqihu on November 08, 2006 at 08:43 PM
-
I think it's a great idea, although on Firefox (currently running 2.0 on Windows), applets in pages tend to be a stop-the-world event (hold your breath! can't wait!). Wonder if it would be better to assign the applet/object tag once the page has loaded, into a waiting div? never tried that, but at least all the page content would show. Anyway, that is one big issue. I like the general idea.
There's a sort of paradigm conflict at work. Applets in my experience offer a similar user experience to Adobe Reader, in that one has this long pause/wait while the content is loaded and fed to an embedded application. Flash tends to be much less disruptive, partly because the splash screen can be customized to make the wait less irritating, and partly because you can usually just skip past the intros if you don't want them--the browser chugs along as normal. I wonder what they are doing, on a technical level, that is so different from what is going on with the applet container.
I remember one thing that excited my with the first JDNC demos was that one could download a layout and binding and have the application build itself on the fly. It performed really well and seemed like a good paradigm to work from--but it hasn't gained traction for some reason.
Nice experiments, Chet. Keep it up.
Patrick
Posted by: pdoubleya on November 09, 2006 at 01:07 AM
-
This is probably a dumb question, but here goes: can this interaction between the ajax/web-stuff and java-applets be done using just the microsoft VM?Thanks, Keith
Posted by: commanderkeith on November 09, 2006 at 04:46 AM
-
2pdoubleya: I'm no expert but I believe one factor may be in the way different browsers load the plug-ins: firefox/mozilla do it on the same browser thread, which is why the browser appears dead until the plug-in is loaded. Being a small plugin (like flash) helps as it just reduces the wait time..
Dmitri
Posted by: trembovetski on November 09, 2006 at 10:39 PM
-
hi, we've been using a similar technique (Applets+AJAX) to implement the visualiser in the Enron Explorer. You can find more information in the blog post
"Bringing new life to applets with Ajax".
Jan
Posted by: jberkel on November 20, 2006 at 10:08 AM
-
That is very good! I support you
域名注册虚拟主机
Posted by: fuvicky on January 31, 2007 at 11:03 PM
-
This is not a new idea which a customer of ours uses in production for several years, but its not all that great and has several problems when compared to the alternatives: AJAX or embedded Flash.
Browser freezes the first time you go into a page with an Applet.
Getting "the right Java" installed is remarkably hard, often an older version will exist and installing Java is just a huge pain.
Building something like this is considerably harder than all the alternatives due to lack of tools... You rarely write standard JavaScript code, you usually use a library or tool to help you along. All of this and the toolchains involved don't exist here.
Applets are remarkably flaky, sure this is in a large part due to browser connectivity but where the fault lies is irrelevant.
There were some attempts to make things like this popular a few years ago, but I think this is a bit late.
Posted by: vprise on February 12, 2007 at 12:12 PM
-
I've timed it ... It took 10 seconds to load! Too slow sorry I'm not sold.
Posted by: imjames on February 14, 2007 at 12:59 AM
-
"When showing / hiding the applet: Problem calling js function: netscape.javascript.JSException: Native DOM Object has been released"
Yes, I was getting this error when setting style.display = 'block' to un-display the applet window in my javascript.. Maybe this is obvious, but I found it worked to catch the exception and re-acquire the DOM object at that time with
m_js_object = JSObject.getWindow(this);
Posted by: saund on October 17, 2007 at 10:51 AM
|