Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / January 2006

Tip: Looking for answers? Try searching our database.

Applet looking for class file improperly

Thread view: 
Roedy Green - 12 Jan 2006 10:07 GMT
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.

Signature

Canadian Mind Products, Roedy Green.
http://mindprod.com Java custom programming, consulting and coaching.

Roedy Green - 12 Jan 2006 10:19 GMT
On Thu, 12 Jan 2006 10:07:52 GMT, Roedy Green
<my_email_is_posted_on_my_website@munged.invalid> wrote, quoted or
indirectly quoted someone who said :

>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.
Signature

Canadian Mind Products, Roedy Green.
http://mindprod.com Java custom programming, consulting and coaching.

isamura - 12 Jan 2006 15:37 GMT
: I was having a peek at the error log on my website and discovered all
: kinds of errors of this form:
[quoted text clipped - 19 lines]
: 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
Roedy Green - 12 Jan 2006 21:43 GMT
>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

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]-->
Signature

Canadian Mind Products, Roedy Green.
http://mindprod.com Java custom programming, consulting and coaching.

isamura - 12 Jan 2006 22:58 GMT
: >http://ww2.cs.fsu.edu/~steele/XHTML/appletObject.html
:
[quoted text clipped - 6 lines]
: 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
Oliver Wong - 13 Jan 2006 21:26 GMT
>>http://ww2.cs.fsu.edu/~steele/XHTML/appletObject.html
>
[quoted text clipped - 44 lines]
>      </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
Shayne Steele - 17 Jan 2006 18:29 GMT
>     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
Oliver Wong - 18 Jan 2006 15:27 GMT
>>     IMHO, the concept behind the second approach is good, but the
>> executation was poor.
[quoted text clipped - 7 lines]
> "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
Shayne Steele - 18 Jan 2006 20:32 GMT
>>>    IMHO, the concept behind the second approach is good, but the
>>>executation was poor.
[quoted text clipped - 20 lines]
>
>     - 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).


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.