Roedy Green wrote:
> On Tue, 29 Jan 2008 12:04:18 -0500, "Aaron J. Margosis"
> <> wrote, quoted or indirectly quoted someone
> who said :
>
>> Is the <APPLET> tag the way they usually go, or do they use
>> another mechanism?
>
> <applet works fine. The other variations are so complicated and silly
> you need automation to generate them. You can't maintain them
> manually.
>
> The only advantage of the others is you they will install Java if it
> is not there. You can get the same effect with a separate button, once
> per page, whose intent is clearer.
>
> See http://mindprod.com/jgloss/applet.html
Note the APPLET tag was removed from the HTML standard. It's
not in the current HTML 5 draft either. The official method
is to use the OBJECT tags, nested as in this example for JavaSE 1.4:
<!-- Simple OBJECT tag, works with modern mozilla and other browsers: -->
<object classid="java:Foo.class" height="200" width="300">
<!-- More complex OBJECT tag, works with some older browsers,
and includes support to download the plug-in if missing/old: -->
<object classid="clsid:8AD9C840-044E-11D1-B3E9-00805F499D93"
width="300" height="200"
codebase="http://java.sun.com/products/plugin/autodl/jinstall-1_4-windows-i586.cab#Version=1,4,0,0"
standby="Loading Applet...">
<param name="code" value="Foo.class">
</object>
</object>
Not all of these attributes are standard. Also using param tags this way
limits their use for real applet parameters.
I believe it was MS that insisted on the removal of the applet tag from HTML 4.
What I find interesting is that MS IIS servers will parse all html files it serves,
and refuse to serve any with nested object tags (support for which is required in
the HTML standard)! Apparently MS doesn't want to support standard HTML that
can run the same from any server or user agent.
At one point MS removed support for the applet tag from IE, but at that point
you couldn't run applets unless you uses JavaScript to generate appropriate
object tags for your system. Sun provides a tool, htmlconverter, that replaces
applet tags in html files with the appropriate 20 lines or so of JavaScript.
Using htmlconverter or object tags with support for checking JRE version and
downloading the latest may require updating your html files every time Sun
releases a newer JRE.
However today all browsers seem to support the applet tag correctly, and that
is the recommended solution. If HTML compliance is an issue for your organization
you should use applect tags for development and htmlconverter for production.
Why HTML 5 draft won't include the applet tag is a mystery to me. (I see
they did add back the embed tag.) Every user agent I know of supports it
the same way, and support for alternatives such as nested object tags
is not universal. *sigh*
(Maybe using Java Web Start is a better option when possible as an alternative
to applets.)
-Wayne