aspose file tools*
The moose likes Applets and the fly likes Applet Caching problem Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Applets
Bookmark "Applet Caching problem" Watch "Applet Caching problem" New topic
Author

Applet Caching problem

Sachin Adat
Ranch Hand

Joined: Sep 03, 2007
Posts: 213
How do you disable caching when using the <APPLET> tag or while using the deployJava.runApplet function for loading latest jre and loading the applet?
I am able to disable caching using the <OBJECT> and <EMBED> tags. Don't know how to use it while using deployJava.js?
I also saw deploying applets using Java Network Launch Protocol (JNLP).
Is this the way to go?

The applet that I deploy becomes a sticky applet and it does not reload even when the jar file is changed..........
Do I have to change the declaration of the applet every time changing something in it or do I have to change something in my class.........
Does serialVersionUID have something to do with this?


SCJP 6
How To Ask Questions On Java Ranch - How To Answer Questions On Java Ranch
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42285
    
  64
The applet that I deploy becomes a sticky applet and it does not reload even when the jar file is changed. Do I have to change the declaration of the applet every time changing something in it or do I have to change something in my class.

That's odd. Does the browser ask for the jar file each time the applet is started? Looking at the messages in the Java Console and your server access logs should tell you. If the server returns a 304 status for the jar file even though it is changed, then that's the problem - maybe the date on the newly changed jar file is incorrect.

Does serialVersionUID have something to do with this?

No.


Ping & DNS - my free Android networking tools app
Sachin Adat
Ranch Hand

Joined: Sep 03, 2007
Posts: 213
Does the browser ask for the jar file each time the applet is started?

How do I know this? I can't say whether it is asking or not...but it is surely not getting the latest jar(I've checked the java console).
If the server returns a 304 status for the jar file even though it is changed, then that's the problem - maybe the date on the newly changed jar file is incorrect.
How do I find what status is returned by the server? The server side is done in PHP. I don't know much about it.
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42285
    
  64
The Java Console should have a line in it that indicates which file the JVM is trying to download.

The definite answer would be in the server access logs. It would indicate which files are requested, and what response the server sends (200, 304 or something else).
Sachin Adat
Ranch Hand

Joined: Sep 03, 2007
Posts: 213
Ulf Dittmer wrote:The Java Console should have a line in it that indicates which file the JVM is trying to download.

Didn't get this line........
Ulf Dittmer wrote:The definite answer would be in the server access logs. It would indicate which files are requested, and what response the server sends (200, 304 or something else).
But, this was 200. Then I checked the modified date and it was the old jar's modified date. Don't know why it is not changed. We are using Winscp for transferring files. So, I guess there is some problem with that. I'll always check if the modified date is changed to get clear results.

Thanks for the help. Very helpful.........

Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42285
    
  64
Do you know what the Java Console is? It's a little client-side window that shows what's going on in the JVM.
Sachin Adat
Ranch Hand

Joined: Sep 03, 2007
Posts: 213
Ulf Dittmer wrote:Do you know what the Java Console is? It's a little client-side window that shows what's going on in the JVM.

I think yes........but after you asked I am not that confident because I cannot see the line in it that indicates which file the JVM is trying to download.

The window name is "Java Console". I open it by right-clicking the java icon on the tray and clicking "Open 1.6.0_13 Console"
All it shows is this

Java Plug-in 1.6.0_13
Using JRE version 1.6.0_13 Java HotSpot(TM) Client VM
....
....
....

Is there any other console that I need to check......
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42285
    
  64
Yes, that's what I'm talking about. But as I said "there should be a message" - I see it in mine, but apparently different JVM versions behave differently.
Sachin Adat
Ranch Hand

Joined: Sep 03, 2007
Posts: 213
Ulf Dittmer wrote:but apparently different JVM versions behave differently.

Maybe you are right.......Is your os not windows(mine is).
Maybe, because of that the JVM's behave differently.

Thanks again for your help..........
The behaviour was quiet a mystery to me for a few days. Now I know what was the problem.....
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Applet Caching problem