[thelist] Using <object> for java applet

Benjamin Hawkes-Lewis bhawkeslewis at googlemail.com
Tue Dec 16 04:55:43 CST 2008

Bill Moseley wrote:
> I'm working on a page that uses this file upload applet:
>     http://www.javaatwork.com/java-upload-applet/install.html
> But the page is xhtml and I believe I should be using <object>.

Note that XHTML Transitional and XHTML Frameset both include "applet".

Switching may not be easy.

> I'm finding sometimes the applet (using the <applet> tag) will load
> in Firefox but not in IE.


> I'm curious is this is the current recommended approach to include a
> java applet:
>     http://ww2.cs.fsu.edu/~steele/XHTML/appletObject.html

That's what Mozilla recommend:


It's also worth reading what Sun have to say:





I'd follow Mozilla's recommendations for non-IE browsers over the crazed 
markup suggested by Sun (<comment> WTF?) but the Sun recommendations are 
still required background reading especially for IE.

> Specifically, the "XHTML (using object tag)" shown at the bottom.
> Also, you might note that the <apple> example from the first link
> has a "codebase" and then relative archives:
>     archive="myuploader-free-signed-v161.jar, labels.jar"
> What I'm doing instead is using *not* using the codebase and instead
> using full urls for the two jar files.  Can I do that also with
> <object>?

Dunno. According to the HTML4 spec, the "codebase" attribute specifies a 
base URI for other attributes, but the "archive" attribute may include 
relative or absolute URIs.

Note also that according to the spec, whereas the "archive" attribute of 
"applet" is comma separated, the "archive" attribute of "object" is 
space separated:



Also note that in Internet Explorer's implementation of OBJECT and 
APPLET, "codebase" is used as a URL from which to download a required 
plugin rather than a base URI for other attributes:


while "archive" is ignored:


Benjamin Hawkes-Lewis

More information about the thelist mailing list