Wednesday, January 23, 2013

Tomcat - If a JSP change does not reflect on your browser

If you face an issue in which you’re JSP changes does not reflect on your browser even after restart of your tomcat server, there could be two possible reasons -

1. Cache - This happens mostly with Internet explorer. IE does caching of JavaScript/CSS and even images in browser, hence even if u make changes to your JSP file it does not reflect on the browser. IE simply displays data from browsers cache instead of getting new data from server. To resolve this you need to clear cache of the browser and perhaps close the browser and reopen it.

2. Tomcat - The work directory is where Tomcat writes any files that it needs during runtime, such as the generated servlet code for JSPs.

Example - C:\apache-tomcat-7.0.11\work\Catalina\localhost

Even if you deployed latest code in your webapp directory changes does not reflect on your browser, the possible reason could be tomcat not able to write changes in work directory. To resolve this you can go to above directory and delete those temp files.