Reputation: 5366
I was under the impression that if I deployed my application (using Ant) then JS files, along with HTML, CSS and images, would be automatically served by Tomcat.
However, after editing Javascript files I have to restart Tomcat in order for the changes to be updated.
My JS files are in a 'js' directory off of root (not in WEB-INF).
I am using FF3.6.
Any help?
Upvotes: 0
Views: 9399
Reputation: 5366
I found out that Tomcat reload files from the /temp directory which was set by setting antiresourcelocking to true in the context xml's. Thanks guys.
Upvotes: 1
Reputation: 486
According to http://tomcat.apache.org/tomcat-5.5-doc/config/context.html
cachingAllowed - If the value of this flag is true, the cache for static resources will be used. If not specified, the default value of the flag is true.
Upvotes: 2
Reputation: 449783
I 've never worked with Tomcat but I find it hard to imagine it wouldn't serve changed JS files straight awayafter deployment. My guess is this is a caching issue on the browser's side. Can you try to force a refresh by opening the actual CSS file and pressing F5?
The usual approach to making sure a JS file gets updated is embedding it with a GET parameter that marks the version/revision:
<script type="text/javascript" src="/js/script.js?version=51"></script>
when you update the script's revision, and change the GET parameter, the browser should forget the cached version and re-load the file.
Upvotes: 5