问题描述:

I have a GWT application which is secured by Spring Security. I have a Main.html which serves the application and Login.html for login. For most part everything works fine everytime. But sometimes after restarting my application I can still access Main.html - although most of the widgets on the page are unusable. I can see the Login.html's HTML in the console being printed as exception. On refreshing, it takes me to login page. Has anyone ran into similar issue? Is this some kind of caching issue? How can this be avoided?

网友答案:

It seems that in your case your bootstrap file is beining cached and thus a wrong version of your app is being loaded. You have to make sure that your bootstrap file (the one which is named nocache) is never cached. See here for more details.

You can check if your bootstrap file is cached by using Firebug and looking at the HTTP requests for your scripts. You can check two things:

  • If the correct <md5>.cache.html are loaded (compare it to the ones in your gwt output folder).
  • The response type of your .nocache. file is not 304 or so.
网友答案:

Adding meta tag on top of my Main.html - helped me resolve my issue for now.

Read this for more details : HTML http-equiv Attribute

相关阅读:
Top