You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by re...@apache.org on 2003/12/04 15:07:08 UTC

cvs commit: jakarta-tomcat-connectors/util/java/org/apache/tomcat/util/http/mapper Mapper.java

remm        2003/12/04 06:07:08

  Modified:    util/java/org/apache/tomcat/util/http/mapper Mapper.java
  Log:
  - Fix NPE when there's no default servlet.
  - Bug 25199. Submitted by Torsten Fohrer.
  
  Revision  Changes    Path
  1.31      +5 -3      jakarta-tomcat-connectors/util/java/org/apache/tomcat/util/http/mapper/Mapper.java
  
  Index: Mapper.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-connectors/util/java/org/apache/tomcat/util/http/mapper/Mapper.java,v
  retrieving revision 1.30
  retrieving revision 1.31
  diff -u -r1.30 -r1.31
  --- Mapper.java	21 Aug 2003 01:20:39 -0000	1.30
  +++ Mapper.java	4 Dec 2003 14:07:08 -0000	1.31
  @@ -697,7 +697,7 @@
                       // Rule 4c -- Welcome resources processing
                       //            for physical folder
                       if (mappingData.wrapper == null
  -                            && context.resources != null) {
  +                        && context.resources != null) {
                           Object file = null;
                           String pathStr = path.toString();
                           try {
  @@ -708,7 +708,8 @@
                           if (file != null && !(file instanceof DirContext) ) {
                               internalMapExtensionWrapper(extensionWrappers,
                                                           path, mappingData);
  -                            if (mappingData.wrapper == null) {
  +                            if (mappingData.wrapper == null
  +                                && context.defaultWrapper != null) {
                                   mappingData.wrapper =
                                       context.defaultWrapper.object;
                                   mappingData.requestPath.setChars
  @@ -738,6 +739,7 @@
                   mappingData.wrapperPath.setChars
                       (path.getBuffer(), path.getStart(), path.getLength());
               }
  +            // Redirection to a folder
               char[] buf = path.getBuffer();
               if (context.resources != null && buf[pathEnd -1 ] != '/') {
                   Object file = null;
  @@ -747,7 +749,7 @@
                   } catch(NamingException nex) {
                       // Swallow, since someone else handles the 404
                   }
  -                if (file != null && file instanceof DirContext ) {
  +                if (file != null && file instanceof DirContext) {
                       // Note: this mutates the path: do not do any processing 
                       // after this (since we set the redirectPath, there 
                       // shouldn't be any)
  
  
  

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