Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to know that app version changed in GWT?
    text
    copied!<p>I have a use case where my GWT application is running on a client browser and I stop my tomcat and update the relevant WAR.<br> What I'd like to happen is that once I load the tomcat every existing client will be reloaded automatically so they will be using the correct version of the application.<br><br> Currently I'm facing two problems:<br></p> <ol> <li>I don't know how to signal to the currently loaded application that it's obsolete and it should reload. I'm thinking of <strong>somehow</strong> identifying in my app that the reason for the GWT-RPC failure is 404 and so it should reload, but I'm not sure how this could be identified. I cannot reload on every GWT-RPC of course as the server might just be down for no reason and will be back up in a second or two without a problem.<br></li> <li>For some reason, the moduleName.nocache.js file is cached and so even if I manually refresh I can see a 404 request on the server as the app is looking for a non existent resource (the previous version), once I delete the cache of the browser this is resolved. Does anyone have any ideas why this is cached? I have changed nothing, in this regard, to the server settings.</li> </ol> <p><strong>Edit:</strong><br> 1. It seems there is no GWT straightforward way of doing this so what I've decided is that when a module loads it receives a <code>module version</code>, a Double, and if a GWT-RPC fails the module queries the Server for its current <code>module version</code> and if there is a mismatch it reloads the page. The GWT-RPC which is used to query the module version is constant and won't be changed for compatibility reasons. This way, even if all other GWT-RPC methods change the module is guaranteed this method will be valid.<br> 2. It seems, thanks to BalusC's suggestion, that the file is cached for 5-10 minutes only and that's why I've been seeing non-deterministic behavior in this area. I've opened <a href="https://stackoverflow.com/questions/3540786/how-to-set-expires-http-header-on-a-single-js-file-in-apache-tomcat">another question</a> on how to set the headers on a single js file as I read somewhere that it's related to the container and not to GWT. Thanks,<br> Ittai</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload