Author: violetagg
Date: Sun Dec  7 06:36:18 2014
New Revision: 1643651

URL: http://svn.apache.org/r1643651
Log:
When checking for last modified of a jar file placed in a war file:
- and the URL protocol is jar:file, it is OK to ask for a jar entry:
jar:file:<path-to-war-file>!<path-to-jar-file>
- but when war file is abstract, the URL point directly to the jar file:
e.g. jar:bundleentry:<path-to-jar-file>!/

Modified:
    tomcat/trunk/java/org/apache/jasper/JspCompilationContext.java

Modified: tomcat/trunk/java/org/apache/jasper/JspCompilationContext.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/jasper/JspCompilationContext.java?rev=1643651&r1=1643650&r2=1643651&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/jasper/JspCompilationContext.java (original)
+++ tomcat/trunk/java/org/apache/jasper/JspCompilationContext.java Sun Dec  7 
06:36:18 2014
@@ -25,6 +25,7 @@ import java.net.URL;
 import java.net.URLClassLoader;
 import java.net.URLConnection;
 import java.util.Set;
+import java.util.jar.JarEntry;
 
 import javax.servlet.ServletContext;
 import javax.servlet.jsp.tagext.TagInfo;
@@ -363,7 +364,12 @@ public class JspCompilationContext {
                 }
                 uc = jspUrl.openConnection();
                 if (uc instanceof JarURLConnection) {
-                    result = ((JarURLConnection) uc).getJarEntry().getTime();
+                    JarEntry jarEntry = ((JarURLConnection) uc).getJarEntry();
+                    if (jarEntry != null) {
+                        result = jarEntry.getTime();
+                    } else {
+                        result = uc.getLastModified();
+                    }
                 } else {
                     result = uc.getLastModified();
                 }



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org

Reply via email to