I am writing a java web-application program to create a file(a simple xml file) in hard disk. The program can update the file dynamically. After its creation/update, I want to see the contents of that file from another application(e.g. browser). The problem is that the browser is not aware of the new modifications made in the file. This is resolved if I refresh the eclipse project manuall开发者_Go百科y(However, I want the browser to see updated file contents each time I refresh the browser after the file is modified within the web application). So, I think there's some issue with Tomcat/java not releasing the handle of the file or maintaining cache.
Please suggest.
No, the issue is not with Tomcat. It's with Eclipse. You must refresh your eclipse project vs the project directory on disk.
The alternative is to use external Tomcat (or Jetty) for testing your webapp.
Set Response no-cache headers.
精彩评论