Bug 61125 - WarURLConnection always returns 0 from getLastModified() which prevents JSP modifications from triggering recompilation
Summary: WarURLConnection always returns 0 from getLastModified() which prevents JSP m...
Alias: None
Product: Tomcat 8
Classification: Unclassified
Component: Catalina (show other bugs)
Version: 8.5.15
Hardware: PC Mac OS X 10.1
: P2 normal (vote)
Target Milestone: ----
Assignee: Tomcat Developers Mailing List
Depends on:
Reported: 2017-05-25 20:27 UTC by Andy Wilkinson
Modified: 2017-05-26 11:34 UTC (History)
0 users


Note You need to log in before you can comment on or make changes to this bug.
Description Andy Wilkinson 2017-05-25 20:27:32 UTC
When JspCompilationContext is attempting to get the last modified time for a JSP it gets a URL for it and opens a connection. When this is a war: URL it gets a WarURLConnection and calls getLastModified(). This method always returns zero. As a result, a JSP is compiled the first time it is accessed but any subsequent changes are then ignored, even across a restart of Tomcat (assuming that the work directory is left intact).
Comment 1 Mark Thomas 2017-05-26 11:10:40 UTC
I can reproduce this and I'm working on a fix. Out of interest is this a regression or a bug you've just noticed?
Comment 2 Andy Wilkinson 2017-05-26 11:19:18 UTC
As far as I know, this isn't a regression.
Comment 3 Mark Thomas 2017-05-26 11:34:32 UTC
Thanks. And thanks for the report.

Fixed in:
- trunk for 9.0.0.M22 onwards
- 8.5.x for 8.5.16 onwards
- 8.0.x for 8.0.45 onwards