Applet looking for class file improperly

R

Roedy Green

I was having a peek at the error log on my website and discovered all
kinds of errors of this form:

[Thu Jan 12 01:13:59 2006] [error] [client 84.58.217.241] File does
not exist:
net:/com/mindprod/www/jgloss/com.html/mindprod/borders/Borders.class,
referer: http://mindprod.com/jgloss/border.html


that corresponds to

<applet code="com.mindprod.borders.Borders.class"
archive="../applets/borders.jar" width="430" height="250" alt="JPanel
Borders">
Need Java to see this.
</applet><p>

It looks like the browser is asking the server for the class even
though it has been given an archive. I don't know what browser(s) do
this.

Perhaps I should not tell it the main class, and trust the manifest.
Even so the name is screwed up. They added an .html to the first leg
of the package name.
 
R

Roedy Green

It looks like the browser is asking the server for the class even
though it has been given an archive. I don't know what browser(s) do
this.

I thought OK, take out the <applet code parameter and let the browser
look for the Main-Class entry in the jar. No joy. Opera just displays
a gray square with NO error message.

Phtt.
 
I

isamura

: I was having a peek at the error log on my website and discovered all
: kinds of errors of this form:
:
: [Thu Jan 12 01:13:59 2006] [error] [client 84.58.217.241] File does
: not exist:
: net:/com/mindprod/www/jgloss/com.html/mindprod/borders/Borders.class,
: referer: http://mindprod.com/jgloss/border.html
:
:
: that corresponds to
:
: <applet code="com.mindprod.borders.Borders.class"
: archive="../applets/borders.jar" width="430" height="250" alt="JPanel
: Borders">
: Need Java to see this.
: </applet><p>
:
: It looks like the browser is asking the server for the class even
: though it has been given an archive. I don't know what browser(s) do
: this.
:
: Perhaps I should not tell it the main class, and trust the manifest.
: Even so the name is screwed up. They added an .html to the first leg
: of the package name.
:
This may or may not help but do have a look at

http://ww2.cs.fsu.edu/~steele/XHTML/appletObject.html

..k
 
R

Roedy Green


This is just too ridiculous for words. <object and classid are the
creations of a Nazi bureaucrat.


How much actual variable information is in there:

archive=sample.jar
height=300
width=450

that's it. Look how this balloons:


HTML (using applet tag)


<!-- Compatible with all browsers -->
<applet code="Sample2"
archive="Sample2.jar"
height="300" width="450" >
</applet>
XHTML (using object tag)


<!--[if !IE]> Firefox and others will use outer object -->
<object classid="java:Sample2.class"
type="application/x-java-applet"
archive="Sample2.jar"
height="300" width="450" >
<!--<![endif]-->
<!-- MSIE (Microsoft Internet Explorer) will use inner object
-->
<object classid="clsid:8AD9C840-044E-11D1-B3E9-00805F499D93"

codebase="http://java.sun.com/update/1.5.0/jinstall-1_5_0-windows-i586.cab"
height="300" width="450" >
<param name="code" value="Sample2" />
<param name="archive" value="Sample2.jar" />
<strong>
This browser does not have a Java Plug-in.
<br />
<a
href="http://java.sun.com/products/plugin/downloads/index.html">
Get the latest Java Plug-in here.
</a>
</strong>
</object>
<!--[if !IE]> close outer object -->
</object>
<!--<![endif]-->
 
I

isamura

: quoted or indirectly quoted someone who said :
:
: >
: >http://ww2.cs.fsu.edu/~steele/XHTML/appletObject.html
:
: This is just too ridiculous for words. <object and classid are the
: creations of a Nazi bureaucrat.
:
:
: How much actual variable information is in there:
:
: archive=sample.jar
: height=300
: width=450
:
I did say it may or may not help you, but in my case I use the simplest form (almost same length as
the standard applet tag) so that myApplet.class will also work in IE.

..k
 
O

Oliver Wong

Roedy Green said:

This is just too ridiculous for words. <object and classid are the
creations of a Nazi bureaucrat.


How much actual variable information is in there:

archive=sample.jar
height=300
width=450

that's it. Look how this balloons:


HTML (using applet tag)


<!-- Compatible with all browsers -->
<applet code="Sample2"
archive="Sample2.jar"
height="300" width="450" >
</applet>
XHTML (using object tag)


<!--[if !IE]> Firefox and others will use outer object -->
<object classid="java:Sample2.class"
type="application/x-java-applet"
archive="Sample2.jar"
height="300" width="450" >
<!--<![endif]-->
<!-- MSIE (Microsoft Internet Explorer) will use inner object
-->
<object classid="clsid:8AD9C840-044E-11D1-B3E9-00805F499D93"

codebase="http://java.sun.com/update/1.5.0/jinstall-1_5_0-windows-i586.cab"
height="300" width="450" >
<param name="code" value="Sample2" />
<param name="archive" value="Sample2.jar" />
<strong>
This browser does not have a Java Plug-in.
<br />
<a
href="http://java.sun.com/products/plugin/downloads/index.html">
Get the latest Java Plug-in here.
</a>
</strong>
</object>
<!--[if !IE]> close outer object -->
</object>
<!--<![endif]-->

To be fair, the second version provides additional information over the
former, and is also more general (in theory).

The first method uses a very specific tag, applet, and gives a reference
to the applet ot run, as well as the dimensions the applet should take up.

The second uses a more generic tag, object, that can load any plug-in
content (e.g. Flash, Quicktime movies, Java applets, activeX controls,
etc.). It provides a path to the file the plugin should download to render
the content, and the dimensions it should be rendered in.

Since multiple plugins may share a given file extension, it provides
something like a MIME Type (application/x-java-applet). In case there are
multiple, conflicting plugins which can handle the same mimetype, a
preferred plugin is given via a universally unique identifier
("clsid:8AD9C840-044E-11D1-B3E9-00805F499D93").

Furthermore, if the user does not have a plugin capable of rendering the
content, a link to a location where the plugin may be automatically
downloaded and installed is provided.

And failling the automated download, a completely customizeable an
alternative content can be provided to the user.

IMHO, the concept behind the second approach is good, but the
executation was poor.

- Oliver
 
S

Shayne Steele

IMHO, the concept behind the second approach is good, but the
executation was poor.

- Oliver

Well...mighty opinionated aren't we :) If you can do better, please
do. I spent a long time coming up with that solution, it works on ALL
the browsers and java plugin I have tried it on AND it allows for
graceful failure. Please feel free to show a better solution that uses
the "object" tag, and is valid XHTML, and works on all browsers and
plugins, and allows for graceful failure.

Shayne
 
O

Oliver Wong

Shayne Steele said:
Well...mighty opinionated aren't we :) If you can do better, please do.
I spent a long time coming up with that solution, it works on ALL the
browsers and java plugin I have tried it on AND it allows for graceful
failure. Please feel free to show a better solution that uses the
"object" tag, and is valid XHTML, and works on all browsers and plugins,
and allows for graceful failure.

When I said "the second approach", I mean "Microsoft's approach". I.e. I
was referring to the concept of having a single tag to represent an embedded
object which gives a pointer to the plugin which can render that object.

This is in contrast to the approach of inventing a new tag for every
possible embeddable object (e.g. "<applet>", "<flash>", "<midi>", "<svg>",
"<mathml>", etc.) and having the browser simply ignore tags it doesn't
recognize.

I didn't mean your XHTML code.

- Oliver
 
S

Shayne Steele

Oliver said:
When I said "the second approach", I mean "Microsoft's approach". I.e. I
was referring to the concept of having a single tag to represent an embedded
object which gives a pointer to the plugin which can render that object.

This is in contrast to the approach of inventing a new tag for every
possible embeddable object (e.g. "<applet>", "<flash>", "<midi>", "<svg>",
"<mathml>", etc.) and having the browser simply ignore tags it doesn't
recognize.

I didn't mean your XHTML code.

- Oliver
OK, sorry about that misunderstanding.

The problem is that the committee that decided to get rid of the applet
tag in favor of the object tag never gave real world working examples of
how to replace the applet tag with an object tag. It took me a long
time to figure out how to do it so it works on all browsers/plugins
(that I have tried).
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,066
Latest member
VytoKetoReviews

Latest Threads

Top