tags:

views:

151

answers:

1

I'm testing a JBoss / Tomcat web application, writing JavaScript tests in .js files. I modify myTest.js, build the .war file and deploy it to JBoss. My Web browser goes to GET the file, but JBoss reports that the file has not been changed so the browser uses the cached version. When I use the FireFox add-on Poster to get the myTest.js file, I see the Last-Modified header is the time of a previous modification, even though the timestamp of myTest.js in the .war file and the timestamp of the .war file itself are up-to-date.

This happens even if I undeploy the application by deleting the .war file and then redeploy it. It happens even if I stop JBoss and restart it.

This makes it very hard to test, because I never know whether the browser is seeing my changes or not.

(I suppose I could rename the file myTest.jsp just to make Tomcat not add the Last-Modified header.)

A: 

Clean up the work directory, or provide your own DefaultServlet, or append a timestamp to the query string, e.g.

<script src="file.js?${config.startupTime}"></script>
BalusC