cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sylv...@apache.org
Subject cvs commit: cocoon-2.1/src/java/org/apache/cocoon/components/treeprocessor TreeProcessor.java
Date Sun, 31 Aug 2003 20:33:19 GMT
sylvain     2003/08/31 13:33:19

  Modified:    src/java/org/apache/cocoon/components/treeprocessor
                        TreeProcessor.java
  Log:
  Fix bug that prevented mime type to be set correctly on internal redirects
  
  Revision  Changes    Path
  1.13      +33 -2     cocoon-2.1/src/java/org/apache/cocoon/components/treeprocessor/TreeProcessor.java
  
  Index: TreeProcessor.java
  ===================================================================
  RCS file: /home/cvs/cocoon-2.1/src/java/org/apache/cocoon/components/treeprocessor/TreeProcessor.java,v
  retrieving revision 1.12
  retrieving revision 1.13
  diff -u -r1.12 -r1.13
  --- TreeProcessor.java	16 Aug 2003 13:42:40 -0000	1.12
  +++ TreeProcessor.java	31 Aug 2003 20:33:19 -0000	1.13
  @@ -50,6 +50,7 @@
   */
   package org.apache.cocoon.components.treeprocessor;
   
  +import java.net.MalformedURLException;
   import java.util.Collections;
   import java.util.HashMap;
   import java.util.List;
  @@ -72,6 +73,7 @@
   import org.apache.avalon.framework.context.ContextException;
   import org.apache.avalon.framework.context.Contextualizable;
   import org.apache.avalon.framework.logger.AbstractLogEnabled;
  +import org.apache.avalon.framework.logger.Logger;
   import org.apache.avalon.framework.thread.ThreadSafe;
   import org.apache.cocoon.Processor;
   import org.apache.cocoon.components.ChainedConfiguration;
  @@ -397,7 +399,7 @@
               environment = facade.getDelegate();
           }
           
  -        Environment newEnv = new EnvironmentWrapper(environment, this.manager, uri, getLogger());
  +        Environment newEnv = new ForwardEnvironmentWrapper(environment, this.manager, uri,
getLogger());
           
           if (facade != null) {
               // Change the facade delegate
  @@ -556,4 +558,33 @@
               this.disposableNodes = null;
           }
       }
  +    
  +    /**
  +     * Local extension of EnvironmentWrapper to propagate otherwise blocked
  +     * methods to the actual environment.
  +     */
  +    private static final class ForwardEnvironmentWrapper extends EnvironmentWrapper {
  +
  +        public ForwardEnvironmentWrapper(Environment env,
  +            ComponentManager manager, String uri, Logger logger) throws MalformedURLException
{
  +            super(env, manager, uri, logger);
  +        }
  +
  +        public void setStatus(int statusCode) {
  +            environment.setStatus(statusCode);
  +        }
  +
  +        public void setContentLength(int length) {
  +            environment.setContentLength(length);
  +        }
  +
  +        public void setContentType(String contentType) {
  +            environment.setContentType(contentType);
  +        }
  +
  +        public String getContentType() {
  +            return environment.getContentType();
  +        }
  +    }
  +
   }
  
  
  

Mime
View raw message