Author: remm
Date: Fri Dec 13 19:45:52 2013
New Revision: 1550823

URL: http://svn.apache.org/r1550823
Log:
Fix getting last modified for tagfiles in JAR so that it is not marked as not 
found. I chose to not fix and use getResource in that case (it looked slower to 
go through the URL since the point is to avoid using JAR URLs I suppose), but 
this could need fixing too just in case it is used.

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=1550823&r1=1550822&r2=1550823&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/jasper/JspCompilationContext.java (original)
+++ tomcat/trunk/java/org/apache/jasper/JspCompilationContext.java Fri Dec 13 
19:45:52 2013
@@ -350,16 +350,23 @@ public class JspCompilationContext {
         long result = -1;
         URLConnection uc = null;
         try {
-            URL jspUrl = getResource(resource);
-            if (jspUrl == null) {
-                incrementRemoved();
-                return Long.valueOf(result);
-            }
-            uc = jspUrl.openConnection();
-            if (uc instanceof JarURLConnection) {
-                result = ((JarURLConnection) uc).getJarEntry().getTime();
+            if (tagJar != null) {
+                if (resource.startsWith("/")) {
+                    resource = resource.substring(1);
+                }
+                result = tagJar.getLastModified(resource);
             } else {
-                result = uc.getLastModified();
+                URL jspUrl = getResource(resource);
+                if (jspUrl == null) {
+                    incrementRemoved();
+                    return Long.valueOf(result);
+                }
+                uc = jspUrl.openConnection();
+                if (uc instanceof JarURLConnection) {
+                    result = ((JarURLConnection) uc).getJarEntry().getTime();
+                } else {
+                    result = uc.getLastModified();
+                }
             }
         } catch (IOException e) {
             if (log.isDebugEnabled()) {



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

Reply via email to