jesbox said:
The Java Applet technology seems largely forgotten. Are there
technical reasons for not using Java Applets?
Yes, AJAX is "built in" where Java Applets need a JVM. With GWT (a
Java to Javascript compiler) I can create web based applications
that run on every browser including Apple iPhone and all Android
based systems. I can't do that with Java and even Flash is not
available e.g. on iPhones/iPads
If someone made something like AJAX but using Applets for the client-
side execution, how would that compare to the omnipresent JavaScript
solutions??
The first thing you need is a JSON-parser to be able to use the
nowerdays common data-transfer format (no XML anymore). Then you
are limited to the rectangle the applet is taking and to be able
to access the other parts of the page, you need the - Javascript
based - Bridge to the DOM-tree.
Are there issues with browser compatibility, security or inferior
functionality?
With the standardization of Javascript as ECMA and ISO standard,
compatibility has improved. Security is not really an issue for
something that completely runs on client side and both techniques
(Java and Javascript) have had bugs in the implementation that
allowed code to break the sandbox.
Are Applets actually better but neglected??
There is no simple "is better" here. Applets have many advantages:
- Can access the local file system if signed, AJAX can't
- Runs in an own thread, i.e. you can perform operations in the
background. Javascript runs in one thread only, which is the
reason, why all calls to the server have to be asynchron.
- You can use the full functionality of the JVM (within the
restrictions of the sandbox), allowing you to run anything
you like on the client side using all the libraries that are
already available. That's the reason e.g. the tax and revenue
offices in Germany are using an Applet on their site people
have to use for their vat- and other declarations.
But also disadvantages (that are in my eyes also valid for Flash):
- You're a "blob" in a page. Resizing the page often has no effect
on the applet and in ancient times (and I haven't tried it later)
a printout of the page produced only a grey box where the contents
of the applets should have been.
- You have no real access to the DOM-tree the applet resides in. So
the classic use-case where you use AJAX is quite hard to be imple-
mented with a Java Applet
Regards, Lothar
--
Lothar Kimmeringer E-Mail: (e-mail address removed)
PGP-encrypted mails preferred (Key-ID: 0x8BC3CD81)
Always remember: The answer is forty-two, there can only be wrong
questions!