You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by co...@apache.org on 2001/08/03 04:35:56 UTC
cvs commit: jakarta-tomcat/src/facade22/org/apache/tomcat/facade ServletContextFacade.java
costin 01/08/02 19:35:56
Modified: src/facade22/org/apache/tomcat/facade
ServletContextFacade.java
Log:
According to the servlet spec, we must return null if there is no resource at that
path.
Revision Changes Path
1.6 +5 -1 jakarta-tomcat/src/facade22/org/apache/tomcat/facade/ServletContextFacade.java
Index: ServletContextFacade.java
===================================================================
RCS file: /home/cvs/jakarta-tomcat/src/facade22/org/apache/tomcat/facade/ServletContextFacade.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- ServletContextFacade.java 2001/02/20 03:34:11 1.5
+++ ServletContextFacade.java 2001/08/03 02:35:56 1.6
@@ -140,6 +140,7 @@
InputStream is = null;
try {
URL url = getResource(path);
+ if( url==null ) return null;
URLConnection con = url.openConnection();
con.connect();
is = con.getInputStream();
@@ -158,7 +159,10 @@
log( "Unsafe path " + absPath + " " + rpath );
return null;
}
-
+ File f=new File( realPath );
+ if( ! f.exists() ) {
+ return null;
+ }
try {
return new URL("file", null, 0,realPath );
} catch( IOException ex ) {