tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From funk...@apache.org
Subject svn commit: r618150 - /tomcat/trunk/java/org/apache/catalina/servlets/DefaultServlet.java
Date Mon, 04 Feb 2008 02:10:41 GMT
Author: funkman
Date: Sun Feb  3 18:10:39 2008
New Revision: 618150

URL: http://svn.apache.org/viewvc?rev=618150&view=rev
Log:
http://issues.apache.org/bugzilla/show_bug.cgi?id=44337
Dir listing crashes if no readme-file present

Catch NamingException on resource not found instead of checking for null


Modified:
    tomcat/trunk/java/org/apache/catalina/servlets/DefaultServlet.java

Modified: tomcat/trunk/java/org/apache/catalina/servlets/DefaultServlet.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/servlets/DefaultServlet.java?rev=618150&r1=618149&r2=618150&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/servlets/DefaultServlet.java (original)
+++ tomcat/trunk/java/org/apache/catalina/servlets/DefaultServlet.java Sun Feb  3 18:10:39
2008
@@ -1415,7 +1415,10 @@
                     return buffer.toString();
                 }
             } catch (NamingException e) {
-                throw new ServletException("Error opening readme resource", e);
+                if (debug > 10)
+                    log("readme '" + readmeFile + "' not found", e);
+
+                return null;
             }
         }
 
@@ -1438,7 +1441,10 @@
                         return is;
                 }
             } catch (NamingException e) {
-                throw new ServletException("Error opening XSLT resource", e);
+                if (debug > 10)
+                    log("localXsltFile '" + localXsltFile + "' not found", e);
+
+                return null;
             }
         }
 



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


Mime
View raw message