We use an applet in our website for uploading multiple files/folder tree to the server. Recently we ran into an issue where our code signing certificate was expired and we had to sign the jars again and publish new jars. We use CACHE_VERSION to give each jar a version that way on each browser restart the applet doesn't go to server for checking if a new version is available on the server or not. Refer http://java.sun.com/products/plugin/1.3/docs/appletcaching.html for more details on CACHE_VERSION.
We ran into an issue where even after uploading the new jars to the server and giving them each a different CACHE_VERSION customers were still complaining about the expired certificate dialog. Doing some googling found that its a common problem in Java plugins in most browsers and a restart of browser would fix it. The browsers will check the cache version in an open browser only once and then even if you render the applet tag again it wont check the cache version. Wow so many people hadn't restarted a browser in 2-3 days, as this can happen again where we can push a server change that's incompatible with the old jars, we need to find a solution.
The solution to the problem was simple, every time the jar on server is changed generate a unique name for the jar. This was done by appending the changelist number of the file in svn to jar name in JSP. The jar name can be generated as upload.V13456.jar. At server we can write an apache rewrite rule that would strip of this .V13456 and serve the jar file. We are already doing this for our images. We use a _@version_@ tag in JSP files that gets replaced during build time using python with svn changelist no of that file. Using the same logic here solved the issue.
We ran into an issue where even after uploading the new jars to the server and giving them each a different CACHE_VERSION customers were still complaining about the expired certificate dialog. Doing some googling found that its a common problem in Java plugins in most browsers and a restart of browser would fix it. The browsers will check the cache version in an open browser only once and then even if you render the applet tag again it wont check the cache version. Wow so many people hadn't restarted a browser in 2-3 days, as this can happen again where we can push a server change that's incompatible with the old jars, we need to find a solution.
The solution to the problem was simple, every time the jar on server is changed generate a unique name for the jar. This was done by appending the changelist number of the file in svn to jar name in JSP. The jar name can be generated as upload.V13456.jar. At server we can write an apache rewrite rule that would strip of this .V13456 and serve the jar file. We are already doing this for our images. We use a _@version_@ tag in JSP files that gets replaced during build time using python with svn changelist no of that file. Using the same logic here solved the issue.
That's a clever solution. I've just recently started working with java and applets, and your tutorials have been very helpful.
ReplyDelete