tags:

views:

150

answers:

2
+2  Q: 

reload java applet

hi,

i have a java applet in one html page, later, i modified the java code and regenerate the jar file. all i did is copy the jar file to my web server and brought up the browser to see the updated the appplet, but it still showed the old version. i tried refresh the browser, delete the cookies, still the same. i tried to open that html file by double clicking the file, it open it in browser with the right applet...i deployed the applet with jnlp. anyone knows what might go wrong? Thanks.

+2  A: 

Go to the Java control panel and clear the Java caches. The Java plugin does not use your browser for downloading Jar files.

Jonathan Feinberg
A: 

Jonathan's answer should do the trick, but in future I recommend you to load the applet from a new URL each time you update. For example http://www.domain.com/applet.jar?version=x

Pool
How would you do this in an `<object>` tag (or the deprecated `<applet>` tag)?
BalusC
@BalusC, the optimum way of deploying applets can get convoluted. Previous I asked about the best method http://stackoverflow.com/questions/1028900/what-is-the-rolls-royce-way-to-deploy-a-java-applet but I would recommend using a version unique URL regardless of deployment technique.
Pool
I mean.. **Where** would you add the query string? Here? `archive="Foo.jar?version=1"`
BalusC
Ohana was interested in JNLP so it would be `<jar href="applet.jar?version=x"/>`. The way I do it for non-JNLP is slightly different: I use `codebase="buildNumber"` and `archive="applet.jar"`. I find this is neater and trivial to automate with `ant`.
Pool
@BalusC, this is quite unrelated to your bad advice given on http://stackoverflow.com/questions/2333586/java-5-html-escaping-to-prevent-xss/2333900#2333900
Pool