File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Tomcat and the fly likes Tomcat: Changed JSP not recompiled? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » Tomcat
Bookmark "Tomcat: Changed JSP not recompiled?" Watch "Tomcat: Changed JSP not recompiled?" New topic

Tomcat: Changed JSP not recompiled?

Yan Zhou
Ranch Hand

Joined: Sep 02, 2003
Posts: 137

I am running Tomcat 5.5.12, I just want to see what happens if a JSP changes.

I changed a JSP, tried redeploy, restart TOMCAT, I do not see the change gets picked up. However, if I change a static HTML, it is picked up.

Somehow the changed JSP is not recompiled, I could not find where the compiled JSP is, either.

Did I miss anything?
Craig Jackson
Ranch Hand

Joined: Mar 19, 2002
Posts: 405
Try refreshing your browser. The page may be stored in the browsers cache.

The compiled JSP pages are stored in the

Yan Zhou
Ranch Hand

Joined: Sep 02, 2003
Posts: 137
that is not working, in fact, i did not see the classes in that directory.

Jason Kwok
Ranch Hand

Joined: Mar 31, 2005
Posts: 126
Is the JSP page you've changed included inside another JSP page? If so, you would have to make a change to the parent page to see updates. Very annoying in my opinion!!

Otherwise, another method I've seen solve this problem is by going into the 'work' directory, finding your appropriate web app folder and there you will find your compiled jsp classes. Delete those stubborn classes to force the container to recompile them.
Ramaswamy Srinivasan
Ranch Hand

Joined: Aug 31, 2004
Posts: 295
Yan Zhou ,

Jason is very much right, in his second idea.

I use it often, when things like this occur. Just stop the tomcat, delete the generated servlet classes, under the work directory, restart tomcat again. This should work fine.

Ben Souther

Joined: Dec 11, 2004
Posts: 13410

One possible cause for this is that the system time on your server is out of sync with the one on your workstation.

Tomcat looks at the last modified date of the JSP files to determine whether or not it has been updated since the last recompile.
If you're moving files to the server with dates older than the last recompile, Tomcat will never know to re-generate the servlet code.

If the server is a Unix box the touch command can be used to update the date of the file(s).

Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
I agree. Here's the link:
subject: Tomcat: Changed JSP not recompiled?
It's not a secret anymore!