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 / April 2008

Tip: Looking for answers? Try searching our database.

<OBJECT> tag and applet caching

Thread view: 
james.a.cleland@gmail.com - 01 Apr 2008 19:23 GMT
I'm sure this has been answered before, but I cannot find where. I've
recently switched from using <APPLET> to <OBJECT> for embedding my
java applets. During development, I would like to be able to disable
caching of my applets. It's not convenient to develop the applet as a
java application. I'm developing in Eclipse and serving the applet via
JSP. I need it to reload every time.

Here's what I have so far. The applet is communicating with the
servlet via ObjectInput/OutputStream and they share a jar which
defines data objects. The jars are available to the browser from the /
applets path. The below WORKS, but my applet is still cached. Using
IE7. Thanks for your input.

<object classid = "clsid:8AD9C840-044E-11D1-B3E9-00805F499D93"
       codebase = "http://java.sun.com/update/1.5.0/jinstall-1_5-windows-
i586.cab#Version=5,0,0,5"
       WIDTH = "200" HEIGHT = "200" >
   <PARAM NAME = CODE VALUE = "path.to.my.applet.class" >
   <PARAM NAME = CODEBASE VALUE = "/applets" >
   <param name = "type" value = "application/x-java-
applet;version=1.5">
   <param name = "scriptable" value = "false">
   <PARAM NAME = "cache_option" VALUE="No" >
   <PARAM NAME = "cache_archive" VALUE = "applet.jar,dataobj.jar">
</object>
Wayne - 01 Apr 2008 23:07 GMT
> I'm sure this has been answered before, but I cannot find where. I've
> recently switched from using <APPLET> to <OBJECT> for embedding my
[quoted text clipped - 21 lines]
>     <PARAM NAME = "cache_archive" VALUE = "applet.jar,dataobj.jar">
> </object>

I don't know of any mainstream browser that doesn't cache applets.
There's nothing you can do about it.

I suggest you avoid object tags and go back to applet tags.  The
object tags don't work correctly from a MS IIS server (the web page
will fail to load with nested object tags).  Applet tags are supported
on all servers I know of.

For development, use "appletviewer" to test your applets.  It has a menu
for reload/restart the applet.

-Wayne
Arne Vajhøj - 02 Apr 2008 00:45 GMT
> I suggest you avoid object tags and go back to applet tags.  The
> object tags don't work correctly from a MS IIS server (the web page
> will fail to load with nested object tags).  Applet tags are supported
> on all servers I know of.

Could you explain how object/applet tags depends on HTTP server ?

Both HTML and JAR files are just some bytes seen from the web server
perspective only client side knows what those bytes are.

Or at least that is how I understand it.

Arne
Wayne - 02 Apr 2008 01:27 GMT
>> I suggest you avoid object tags and go back to applet tags.  The
>> object tags don't work correctly from a MS IIS server (the web page
[quoted text clipped - 9 lines]
>
> Arne

Yeah, that's what I thought.  Apparently this is a bug in IIS that
Microsoft knows about for years now, but refuses to fix.  What
happens is you get an ASP error:

    Active Server Pages error 'ASP 0139'
    Nested Object

even if your file extension is .htm or .html.  IIS scans
pages and refuses to serve a page with (perfectly legal)
nested object tags!  Even though it was MS that pushed the
w3c to use object and not applet tags.  I guess this is
part of the MS business model to break Java.

My school uses IIS, they won't switch to Apache for some reason.
I've tried!  But that's how I found all this out.

The work-around is to use IE conditional comments to hide
the nested tags.  But since applet tags work perfectly well,
even if not approved by w3c, I suggest using it.

Maybe HTML 5 will add back the applet tag, I believe they are
adding the embedded tag officially.

-Wayne
Roedy Green - 03 Apr 2008 10:29 GMT
>The work-around is to use IE conditional comments to hide
>the nested tags.  But since applet tags work perfectly well,
>even if not approved by w3c, I suggest using it.

Since Object tags are warfare to destroy Java, and since <applet tags
work fine, and since Object tags are impossible to maintain or
proofread, I suggest ignoring them. They have only one virtue. See
http://mindprod.com/jgloss/applet.html
Signature


Roedy Green Canadian Mind Products
The Java Glossary
http://mindprod.com

Roedy Green - 02 Apr 2008 01:01 GMT
>I don't know of any mainstream browser that doesn't cache applets.
>There's nothing you can do about it.

Browsers load the Applet class. Getting rid of it is the same as the
problem as getting rid of a class you have loaded.  All you really can
do is start up a class loader to load the new version of it and wait
for the old one to die of lack of references.

Signature

Roedy Green Canadian Mind Products
The Java Glossary
http://mindprod.com

Wayne - 02 Apr 2008 01:34 GMT
>> I'm sure this has been answered before, but I cannot find where. I've
>> recently switched from using <APPLET> to <OBJECT> for embedding my
>> java applets. During development, I would like to be able to disable
>> caching of my applets. It's not convenient to develop the applet as a
>> java application. I'm developing in Eclipse and serving the applet via
>> JSP. I need it to reload every time.

> For development, use "appletviewer" to test your applets.  It has a menu
> for reload/restart the applet.
>
> -Wayne

I should add that if you must use W3C complient HTML, you should still
develop using the applet tag.  When ready to deploy you can use
the "htmlconverter" application (part of the JDK) that converts
applet tags to about 20 lines of broswer/server detecting
JavaScript, object, applet, and embed tags, and will work for any browser.

-Wayne
james.a.cleland@gmail.com - 02 Apr 2008 20:08 GMT
Thanks for the discussion on this. Unfortunately, my implementation
depends on the JSP and I'm making use of Liveconnect, so I can't use
the applet viewer and test normally.

Having said that, my solution is to x-c in the Java console to clear
this cache. This works without unloading the JVM and while the applet
is running. It looks like the browser isn't caching any applets. At
least my browser cache doesn't contain any, although I do regularly
use half a dozen, so it must be the JRE. Anyway, clearing through the
console solves my problem.

Also, I have tried HtmlConverter.exe. What a mess of output! Couldn't
we just keep <APPLET>?

Thanks again for your replies.

J
Roedy Green - 03 Apr 2008 10:31 GMT
>will work for any browser.

I suspect if you tried them on all the world's browsers <applet would
be considerably more widely supported.
Signature


Roedy Green Canadian Mind Products
The Java Glossary
http://mindprod.com

Chase Preuninger - 01 Apr 2008 23:18 GMT
I never thought you could do that with HTML.  I thought it was a
browser setting.

http://groups.google.com/group/java-software-develoupment?hl=en
Roedy Green - 02 Apr 2008 01:04 GMT
tOn Tue, 1 Apr 2008 15:18:23 -0700 (PDT), Chase Preuninger
<chasepreuninger@gmail.com> wrote, quoted or indirectly quoted someone
who said :

>I never thought you could do that with HTML.  I thought it was a
>browser setting.
>
>http://groups.google.com/group/java-software-develoupment?hl=en

when you put your url like that, it looks as if you are saying there
is an answer to the caller's question there.  Try something like this:

--(space)
Chase Preuninger
http://groups.google.com/group/java-software-develoupment?hl=en
Signature


Roedy Green Canadian Mind Products
The Java Glossary
http://mindprod.com



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



©2008 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.