cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d...@apache.org
Subject cvs commit: xml-cocoon2/src/webapp/WEB-INF web.xml
Date Sun, 24 Feb 2002 11:10:59 GMT
dims        02/02/24 03:10:58

  Modified:    .        build.xml
               src/java/org/apache/cocoon/environment/http HttpRequest.java
               src/java/org/apache/cocoon/servlet CocoonServlet.java
               src/webapp/WEB-INF web.xml
  Added:       src/java/org/apache/cocoon/components/request
                        MaybeUploadRequestFactoryImpl.java
                        RequestFactory.java SimpleRequestFactoryImpl.java
  Removed:     src/java/org/apache/cocoon/environment/http
                        RequestWrapper22.java RequestWrapper23.java
                        RequestWrapperMaybeUpload22.java
                        RequestWrapperMaybeUpload23.java
  Log:
  Changes:
  - Trying to componentize the RequestWrapper stuff into a separate package under components
as RequestFactory
  - Allow selection of RequestFactory from web.xml
  - Now with these changes you can compile using servlet_2_2.jar and still deploy on Tomcat
4.0.2
  - This will allow more RequestFactory's to be added later and not depend on MaybeUpload.
  - Deployer can choose the RequestFactory Not the person compiling the code :-)
  
  Revision  Changes    Path
  1.172     +3 -56     xml-cocoon2/build.xml
  
  Index: build.xml
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/build.xml,v
  retrieving revision 1.171
  retrieving revision 1.172
  diff -u -r1.171 -r1.172
  --- build.xml	18 Feb 2002 14:09:50 -0000	1.171
  +++ build.xml	24 Feb 2002 11:10:58 -0000	1.172
  @@ -727,6 +727,7 @@
   
           <exclude name="**/components/store/Jisp*.java" unless="jisp.present"/>
           <exclude name="**/jisp.xconf"                  unless="jisp.present"/>
  +        <exclude name="**/MaybeUpload*.java"           unless="maybeupload.present"/>
   
           <exclude name="**/http/RequestWrapper*.java"/>
           <exclude name="**/browser/*.x*"/>
  @@ -745,60 +746,6 @@
     </target>
   
     <!-- =================================================================== -->
  -  <!-- Prepares the servlet 2.3 source code if maybeupload is present      -->
  -  <!-- =================================================================== -->
  -  <target name="prepare-src-23-maybeupload" if="servlet23.present, maybeupload.present">
  -    <copy file="${java.dir}/org/apache/cocoon/environment/http/RequestWrapperMaybeUpload23.java"
  -        tofile="${build.src}/org/apache/cocoon/environment/http/RequestWrapper.java"
  -        filtering="on"
  -        overwrite="true"/>
  -  </target>
  -
  -  <!-- =================================================================== -->
  -  <!-- Prepares the servlet 2.3 source code                                -->
  -  <!-- =================================================================== -->
  -  <target name="prepare-src-23" if="servlet23.present" unless="maybeupload.present">
  -    <copy file="${java.dir}/org/apache/cocoon/environment/http/RequestWrapper23.java"
  -        tofile="${build.src}/org/apache/cocoon/environment/http/RequestWrapper.java"
  -        filtering="on"
  -        overwrite="true"/>
  -  </target>
  -
  -  <!-- =================================================================== -->
  -  <!-- Prepares the servlet 2.2 source code if maybeupload is present      -->
  -  <!-- =================================================================== -->
  -  <target name="prepare-src-22-maybeupload" unless="servlet23.present" if="maybeupload.present">
  -    <copy file="${java.dir}/org/apache/cocoon/environment/http/RequestWrapperMaybeUpload22.java"
  -        tofile="${build.src}/org/apache/cocoon/environment/http/RequestWrapper.java"
  -        filtering="on"
  -        overwrite="true"/>
  -  </target>
  -
  -  <!-- =================================================================== -->
  -  <!-- Prepares the servlet 2.2 source code                                -->
  -  <!-- =================================================================== -->
  -  <target name="prepare-src-22" unless="servlet23.present, maybeupload.present">
  -    <copy file="${java.dir}/org/apache/cocoon/environment/http/RequestWrapper22.java"
  -        tofile="${build.src}/org/apache/cocoon/environment/http/RequestWrapper.java"
  -        filtering="on"/>
  -  </target>
  -
  -  <!-- =================================================================== -->
  -  <!-- Prepares the servlet source                                         -->
  -  <!-- =================================================================== -->
  -  <target name="prepare-src-servlet" depends="prepare-src-main" if="servlet.present">
  -    <antcall target="prepare-src-22"/>
  -    <antcall target="prepare-src-22-maybeupload"/>
  -    <antcall target="prepare-src-23"/>
  -    <antcall target="prepare-src-23-maybeupload"/>
  -  </target>
  -
  -  <!-- =================================================================== -->
  -  <!-- Prepares the source code                                            -->
  -  <!-- =================================================================== -->
  -  <target name="prepare-src" depends="prepare-src-servlet"/>
  -
  -  <!-- =================================================================== -->
     <!-- Set a variable if the generated java code is already up-to-date.    -->
     <!-- =================================================================== -->
     <target name="generate-java-code-check" depends="init">
  @@ -825,7 +772,7 @@
     <!-- =================================================================== -->
     <!-- Compiles the source directory                                       -->
     <!-- =================================================================== -->
  -  <target name="compile" depends="prepare-src"
  +  <target name="compile" depends="prepare-src-main"
             description="Compiles the source code">
       <copy todir="${build.dest}">
         <fileset dir="${build.src}">
  @@ -1299,7 +1246,7 @@
     <!-- =================================================================== -->
     <!-- Creates the API documentation                                       -->
     <!-- =================================================================== -->
  -  <target name="javadocs" depends="prepare-src, javadocs_check, javadocs_done"
  +  <target name="javadocs" depends="prepare-src-main, javadocs_check, javadocs_done"
         unless="javadocs.notrequired"
         description="* Generates the API documentation">
       <mkdir dir="${build.javadocs}"/>
  
  
  
  1.1                  xml-cocoon2/src/java/org/apache/cocoon/components/request/MaybeUploadRequestFactoryImpl.java
  
  Index: MaybeUploadRequestFactoryImpl.java
  ===================================================================
  /*
  
   ============================================================================
                     The Apache Software License, Version 1.1
   ============================================================================
  
   Copyright (C) 1999-2002 The Apache Software Foundation. All rights reserved.
  
   Redistribution and use in source and binary forms, with or without modifica-
   tion, are permitted provided that the following conditions are met:
  
   1. Redistributions of  source code must  retain the above copyright  notice,
      this list of conditions and the following disclaimer.
  
   2. Redistributions in binary form must reproduce the above copyright notice,
      this list of conditions and the following disclaimer in the documentation
      and/or other materials provided with the distribution.
  
   3. The end-user documentation included with the redistribution, if any, must
      include  the following  acknowledgment:  "This product includes  software
      developed  by the  Apache Software Foundation  (http://www.apache.org/)."
      Alternately, this  acknowledgment may  appear in the software itself,  if
      and wherever such third-party acknowledgments normally appear.
  
   4. The names "Apache Cocoon" and  "Apache Software Foundation" must  not  be
      used to  endorse or promote  products derived from  this software without
      prior written permission. For written permission, please contact
      apache@apache.org.
  
   5. Products  derived from this software may not  be called "Apache", nor may
      "Apache" appear  in their name,  without prior written permission  of the
      Apache Software Foundation.
  
   THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
   INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
   FITNESS  FOR A PARTICULAR  PURPOSE ARE  DISCLAIMED.  IN NO  EVENT SHALL  THE
   APACHE SOFTWARE  FOUNDATION  OR ITS CONTRIBUTORS  BE LIABLE FOR  ANY DIRECT,
   INDIRECT, INCIDENTAL, SPECIAL,  EXEMPLARY, OR CONSEQUENTIAL  DAMAGES (INCLU-
   DING, BUT NOT LIMITED TO, PROCUREMENT  OF SUBSTITUTE GOODS OR SERVICES; LOSS
   OF USE, DATA, OR  PROFITS; OR BUSINESS  INTERRUPTION)  HOWEVER CAUSED AND ON
   ANY  THEORY OF LIABILITY,  WHETHER  IN CONTRACT,  STRICT LIABILITY,  OR TORT
   (INCLUDING  NEGLIGENCE OR  OTHERWISE) ARISING IN  ANY WAY OUT OF THE  USE OF
   THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  
   This software  consists of voluntary contributions made  by many individuals
   on  behalf of the Apache Software  Foundation and was  originally created by
   Stefano Mazzocchi  <stefano@apache.org>. For more  information on the Apache
   Software Foundation, please see <http://www.apache.org/>.
  
  */
  package org.apache.cocoon.components.request;
  
  import uk.co.weft.maybeupload.MaybeUploadRequestWrapper;
  
  import javax.servlet.http.HttpServletRequest;
  import java.io.File;
  import java.util.Map;
  import java.util.Vector;
  
  /**
   *
   * Extends the {@link RequestFactory} class
   *
   * @author <a href="mailto:cziegeler@apache.org">Davanum Srinivas</a>
   * @version CVS $Id: MaybeUploadRequestFactoryImpl.java,v 1.1 2002/02/24 11:10:58 dims Exp
$
   */
  
  public final class MaybeUploadRequestFactoryImpl extends RequestFactory {
      /**
       * Return a wrapped request object
       */
      public HttpServletRequest getServletRequest(HttpServletRequest request,
                                                         boolean saveUploadedFilesToDisk,
                                                         File    uploadDirectory,
                                                         boolean allowOverwrite,
                                                         boolean silentlyRename,
                                                         int     maxUploadSize) {
          HttpServletRequest req = request;
          String contentType = req.getContentType();
  
          if (contentType == null) {
              contentType = "application/x-www-form-urlencoded";
          }
  
          if (contentType.startsWith("multipart/form-data")) {
              try {
                  req = new MaybeUploadRequestWrapperEx(request,
                                           saveUploadedFilesToDisk,
                                           uploadDirectory,
                                           allowOverwrite,
                                           silentlyRename,
                                           maxUploadSize);
              } catch (Exception e) {
                  req = request;
              }
          }
  
          return req;
      }
  
      /**
       * Implementation of the get method
       */
      public Object get(HttpServletRequest request, String name) {
          // FIXME We should get rid of this instanceof test
          if (request instanceof MaybeUploadRequestWrapper) {
              return ((MaybeUploadRequestWrapper) request).get(name);
          } else {
              String[] values = request.getParameterValues(name);
  
              if (values == null) return null;
  
              if (values.length == 1) {
                  return values[0];
              }
  
              if (values.length > 1) {
                  Vector vect = new Vector(values.length);
  
                  for (int i = 0; i < values.length; i++) {
                      vect.add(values[i]);
                  }
  
                  return vect;
              }
          }
          return null;
      }
  
      public class MaybeUploadRequestWrapperEx extends MaybeUploadRequestWrapper implements
HttpServletRequest {
          public MaybeUploadRequestWrapperEx(HttpServletRequest httpservletrequest, boolean
flag1, File file, boolean flag2, boolean flag3, int size)
              throws Exception {
              super(httpservletrequest, flag1, file, flag2, flag3, size);
          }
  
          public Map getParameterMap() {
              // FIXME:
              return null;
          }
  
          public void setCharacterEncoding(String s) {
              // FIXME:
          }
  
          public StringBuffer getRequestURL() {
              // FIXME:
              return null;
          }
      }
  }
  
  
  
  
  1.1                  xml-cocoon2/src/java/org/apache/cocoon/components/request/RequestFactory.java
  
  Index: RequestFactory.java
  ===================================================================
  /*
  
   ============================================================================
                     The Apache Software License, Version 1.1
   ============================================================================
  
   Copyright (C) 1999-2002 The Apache Software Foundation. All rights reserved.
  
   Redistribution and use in source and binary forms, with or without modifica-
   tion, are permitted provided that the following conditions are met:
  
   1. Redistributions of  source code must  retain the above copyright  notice,
      this list of conditions and the following disclaimer.
  
   2. Redistributions in binary form must reproduce the above copyright notice,
      this list of conditions and the following disclaimer in the documentation
      and/or other materials provided with the distribution.
  
   3. The end-user documentation included with the redistribution, if any, must
      include  the following  acknowledgment:  "This product includes  software
      developed  by the  Apache Software Foundation  (http://www.apache.org/)."
      Alternately, this  acknowledgment may  appear in the software itself,  if
      and wherever such third-party acknowledgments normally appear.
  
   4. The names "Apache Cocoon" and  "Apache Software Foundation" must  not  be
      used to  endorse or promote  products derived from  this software without
      prior written permission. For written permission, please contact
      apache@apache.org.
  
   5. Products  derived from this software may not  be called "Apache", nor may
      "Apache" appear  in their name,  without prior written permission  of the
      Apache Software Foundation.
  
   THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
   INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
   FITNESS  FOR A PARTICULAR  PURPOSE ARE  DISCLAIMED.  IN NO  EVENT SHALL  THE
   APACHE SOFTWARE  FOUNDATION  OR ITS CONTRIBUTORS  BE LIABLE FOR  ANY DIRECT,
   INDIRECT, INCIDENTAL, SPECIAL,  EXEMPLARY, OR CONSEQUENTIAL  DAMAGES (INCLU-
   DING, BUT NOT LIMITED TO, PROCUREMENT  OF SUBSTITUTE GOODS OR SERVICES; LOSS
   OF USE, DATA, OR  PROFITS; OR BUSINESS  INTERRUPTION)  HOWEVER CAUSED AND ON
   ANY  THEORY OF LIABILITY,  WHETHER  IN CONTRACT,  STRICT LIABILITY,  OR TORT
   (INCLUDING  NEGLIGENCE OR  OTHERWISE) ARISING IN  ANY WAY OUT OF THE  USE OF
   THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  
   This software  consists of voluntary contributions made  by many individuals
   on  behalf of the Apache Software  Foundation and was  originally created by
   Stefano Mazzocchi  <stefano@apache.org>. For more  information on the Apache
   Software Foundation, please see <http://www.apache.org/>.
  
  */
  
  package org.apache.cocoon.components.request;
  
  import org.apache.avalon.framework.component.Component;
  
  import javax.servlet.http.HttpServletRequest;
  import java.io.File;
  
  /**
   * This is the interface of Request Wrapper in Cocoon.
   *
   * @author <a href="mailto:dims@yahoo.com">Davanum Srinivas</a>
   * @version CVS $Id: RequestFactory.java,v 1.1 2002/02/24 11:10:58 dims Exp $
   */
  public abstract class   RequestFactory
          implements Component {
  
      static private RequestFactory factory;
  
      public static synchronized RequestFactory getRequestFactory(String className) {
          if(factory != null)
              return factory;
          try {
              ClassLoader loader = Thread.currentThread().getContextClassLoader();
              Class clazz = loader.loadClass(className);
              factory = (RequestFactory)clazz.newInstance();
          } catch (Throwable t){}
          if(factory == null) {
              try {
                  Class clazz = Class.forName(className);
                  factory = (RequestFactory)clazz.newInstance();
              } catch (Throwable t){}
          }
          if(factory == null)
              factory = new SimpleRequestFactoryImpl();
          return factory;
      }
  
      /**
       * Return a wrapped request object
       */
      public abstract HttpServletRequest getServletRequest(HttpServletRequest request,
                                                  boolean saveUploadedFilesToDisk,
                                                  File uploadDirectory,
                                                  boolean allowOverwrite,
                                                  boolean silentlyRename,
                                                  int maxUploadSize);
      /**
       * Implementation of the get method
       */
      public abstract Object get(HttpServletRequest request, String name);
  }
  
  
  1.1                  xml-cocoon2/src/java/org/apache/cocoon/components/request/SimpleRequestFactoryImpl.java
  
  Index: SimpleRequestFactoryImpl.java
  ===================================================================
  /*
  
   ============================================================================
                     The Apache Software License, Version 1.1
   ============================================================================
  
   Copyright (C) 1999-2002 The Apache Software Foundation. All rights reserved.
  
   Redistribution and use in source and binary forms, with or without modifica-
   tion, are permitted provided that the following conditions are met:
  
   1. Redistributions of  source code must  retain the above copyright  notice,
      this list of conditions and the following disclaimer.
  
   2. Redistributions in binary form must reproduce the above copyright notice,
      this list of conditions and the following disclaimer in the documentation
      and/or other materials provided with the distribution.
  
   3. The end-user documentation included with the redistribution, if any, must
      include  the following  acknowledgment:  "This product includes  software
      developed  by the  Apache Software Foundation  (http://www.apache.org/)."
      Alternately, this  acknowledgment may  appear in the software itself,  if
      and wherever such third-party acknowledgments normally appear.
  
   4. The names "Apache Cocoon" and  "Apache Software Foundation" must  not  be
      used to  endorse or promote  products derived from  this software without
      prior written permission. For written permission, please contact
      apache@apache.org.
  
   5. Products  derived from this software may not  be called "Apache", nor may
      "Apache" appear  in their name,  without prior written permission  of the
      Apache Software Foundation.
  
   THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
   INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
   FITNESS  FOR A PARTICULAR  PURPOSE ARE  DISCLAIMED.  IN NO  EVENT SHALL  THE
   APACHE SOFTWARE  FOUNDATION  OR ITS CONTRIBUTORS  BE LIABLE FOR  ANY DIRECT,
   INDIRECT, INCIDENTAL, SPECIAL,  EXEMPLARY, OR CONSEQUENTIAL  DAMAGES (INCLU-
   DING, BUT NOT LIMITED TO, PROCUREMENT  OF SUBSTITUTE GOODS OR SERVICES; LOSS
   OF USE, DATA, OR  PROFITS; OR BUSINESS  INTERRUPTION)  HOWEVER CAUSED AND ON
   ANY  THEORY OF LIABILITY,  WHETHER  IN CONTRACT,  STRICT LIABILITY,  OR TORT
   (INCLUDING  NEGLIGENCE OR  OTHERWISE) ARISING IN  ANY WAY OUT OF THE  USE OF
   THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  
   This software  consists of voluntary contributions made  by many individuals
   on  behalf of the Apache Software  Foundation and was  originally created by
   Stefano Mazzocchi  <stefano@apache.org>. For more  information on the Apache
   Software Foundation, please see <http://www.apache.org/>.
  
  */
  package org.apache.cocoon.components.request;
  
  import javax.servlet.http.HttpServletRequest;
  import java.io.File;
  import java.util.Vector;
  
  /**
   *
   * Extends the {@link RequestFactory} class
   *
   * @author <a href="mailto:cziegeler@apache.org">Davanum Srinivas</a>
   * @version CVS $Id: SimpleRequestFactoryImpl.java,v 1.1 2002/02/24 11:10:58 dims Exp $
   */
  
  public final class SimpleRequestFactoryImpl extends RequestFactory {
  
      /**
       * Return a wrapped request object
       */
      public HttpServletRequest getServletRequest(HttpServletRequest request,
                                                         boolean saveUploadedFilesToDisk,
                                                         File    uploadDirectory,
                                                         boolean allowOverwrite,
                                                         boolean silentlyRename,
                                                         int     maxUploadSize) {
          return request;
      }
  
      /**
       * Implementation of the get method
       */
      public Object get(HttpServletRequest request, String name) {
          String[] values = request.getParameterValues(name);
  
          if (values == null) return null;
  
          if (values.length == 1) {
              return values[0];
      }
  
          if (values.length > 1) {
              Vector vect = new Vector(values.length);
  
              for (int i = 0; i < values.length; i++) {
                  vect.add(values[i]);
              }
  
              return vect;
          }
          return null;
      }
  }
  
  
  
  1.6       +3 -2      xml-cocoon2/src/java/org/apache/cocoon/environment/http/HttpRequest.java
  
  Index: HttpRequest.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/java/org/apache/cocoon/environment/http/HttpRequest.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- HttpRequest.java	22 Feb 2002 07:03:50 -0000	1.5
  +++ HttpRequest.java	24 Feb 2002 11:10:58 -0000	1.6
  @@ -53,6 +53,7 @@
   import org.apache.cocoon.environment.Cookie;
   import org.apache.cocoon.environment.Request;
   import org.apache.cocoon.environment.Session;
  +import org.apache.cocoon.components.request.RequestFactory;
   
   import javax.servlet.RequestDispatcher;
   import javax.servlet.ServletInputStream;
  @@ -66,7 +67,7 @@
    * to provide request information for HTTP servlets.
    *
    * @author <a href="mailto:giacomo@apache,org">Giacomo Pati</a>
  - * @version CVS $Id: HttpRequest.java,v 1.5 2002/02/22 07:03:50 cziegeler Exp $
  + * @version CVS $Id: HttpRequest.java,v 1.6 2002/02/24 11:10:58 dims Exp $
    */
   
   public class HttpRequest implements Request {
  @@ -95,7 +96,7 @@
       /* The HttpServletRequest interface methods */
   
       public Object get(String name) {
  -        return RequestWrapper.get(this.req, name);
  +        return RequestFactory.getRequestFactory(null).get(this.req, name);
       }
   
       public String getAuthType() {
  
  
  
  1.14      +11 -3     xml-cocoon2/src/java/org/apache/cocoon/servlet/CocoonServlet.java
  
  Index: CocoonServlet.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/java/org/apache/cocoon/servlet/CocoonServlet.java,v
  retrieving revision 1.13
  retrieving revision 1.14
  diff -u -r1.13 -r1.14
  --- CocoonServlet.java	23 Feb 2002 21:15:45 -0000	1.13
  +++ CocoonServlet.java	24 Feb 2002 11:10:58 -0000	1.14
  @@ -65,6 +65,7 @@
   import org.apache.cocoon.components.notification.NotifyingBuilder;
   import org.apache.cocoon.components.notification.DefaultNotifyingBuilder;
   import org.apache.cocoon.components.notification.Notifier;
  +import org.apache.cocoon.components.request.RequestFactory;
   import org.apache.cocoon.ResourceNotFoundException;
   import org.apache.cocoon.ConnectionResetException;
   import org.apache.cocoon.Cocoon;
  @@ -72,7 +73,6 @@
   import org.apache.cocoon.environment.Environment;
   import org.apache.cocoon.environment.http.HttpContext;
   import org.apache.cocoon.environment.http.HttpEnvironment;
  -import org.apache.cocoon.environment.http.RequestWrapper;
   import org.apache.cocoon.util.ClassUtils;
   import org.apache.cocoon.util.IOUtils;
   import org.apache.cocoon.util.StringUtils;
  @@ -118,7 +118,7 @@
    * @author <a href="mailto:bloritsch@apache.org">Berin Loritsch</a>
    * @author <a href="mailto:cziegeler@apache.org">Carsten Ziegeler</a>
    * @author <a href="mailto:leo.sutic@inspireinfrastructure.com">Leo Sutic</a>
  - * @version CVS $Id: CocoonServlet.java,v 1.13 2002/02/23 21:15:45 dims Exp $
  + * @version CVS $Id: CocoonServlet.java,v 1.14 2002/02/24 11:10:58 dims Exp $
    */
   public class CocoonServlet extends HttpServlet {
   
  @@ -165,6 +165,7 @@
       protected RepositoryClassLoader classLoader;
   
       private String parentComponentManagerClass;
  +    private String requestFactoryClass;
   
       protected String forceLoadParameter;
       protected String forceSystemProperty;
  @@ -364,6 +365,13 @@
               }
           }
   
  +        requestFactoryClass = conf.getInitParameter("request-factory");
  +        if (requestFactoryClass == null) {
  +            if (log.isDebugEnabled()) {
  +                log.debug("request-factory was not set - defaulting to null.");
  +            }
  +        }
  +
           this.containerEncoding = conf.getInitParameter("container-encoding");
               if (containerEncoding == null) {
                   containerEncoding = "ISO-8859-1";
  @@ -883,7 +891,7 @@
           // This is more scalable
           long start = System.currentTimeMillis();
           res.addHeader("X-Cocoon-Version", Constants.VERSION);
  -        HttpServletRequest request = RequestWrapper.getServletRequest(req,
  +        HttpServletRequest request = RequestFactory.getRequestFactory(requestFactoryClass).getServletRequest(req,
                                            CocoonServlet.SAVE_UPLOADED_FILES_TO_DISK,
                                            this.uploadDir,
                                            CocoonServlet.ALLOW_OVERWRITE,
  
  
  
  1.4       +37 -29    xml-cocoon2/src/webapp/WEB-INF/web.xml
  
  Index: web.xml
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/webapp/WEB-INF/web.xml,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- web.xml	5 Feb 2002 13:51:53 -0000	1.3
  +++ web.xml	24 Feb 2002 11:10:58 -0000	1.4
  @@ -57,8 +57,8 @@
       </init-param>
   
       <!--
  -      This parameter indicates the category id of the logger from the LogKit 
  -      configuration used by the CocoonServlet. 
  +      This parameter indicates the category id of the logger from the LogKit
  +      configuration used by the CocoonServlet.
       -->
       <init-param>
         <param-name>servlet-logger</param-name>
  @@ -68,8 +68,8 @@
       <!--
         This parameter indicates the category id of the logger from the LogKit
         management configuration for the Cocoon engine.
  -      This logger is used for all components described in the cocoon.xconf 
  -      and sitemap.xmap file not having specified a logger with the 
  +      This logger is used for all components described in the cocoon.xconf
  +      and sitemap.xmap file not having specified a logger with the
         logger="..." attribute in the component configuration file.
       -->
       <init-param>
  @@ -82,7 +82,7 @@
         As soon as the logkit.xconf the setting of the logkit.xconf configuration is
         used instead! Only for startup and if the logkit.xconf is not readable/available
         this log level is of importance.
  - 
  +
         Available levels are:
           DEBUG:        prints all level of log messages.
           INFO:         prints all level of log messages except DEBUG ones.
  @@ -95,7 +95,7 @@
         <param-value>DEBUG</param-value>
       </init-param>
   
  -    <!-- 
  +    <!--
         Allow reinstantiating (reloading) of the cocoon instance. If this is
         set to "yes" or "true", a new cocoon instance can be created using
         the request parameter "cocoon-reload".
  @@ -104,8 +104,8 @@
         <param-name>allow-reload</param-name>
         <param-value>yes</param-value>
       </init-param>
  -  
  -    <!-- 
  +
  +    <!--
         This parameter is used to list classes that should be loaded
         at initialization time of the servlet.
         Usually this classes are JDBC Drivers used
  @@ -113,22 +113,22 @@
       <init-param>
         <param-name>load-class</param-name>
         <param-value>
  -        <!-- For IBM WebSphere: 
  +        <!-- For IBM WebSphere:
           com.ibm.servlet.classloader.Handler -->
   
           <!-- For Database Driver: -->
           @database-driver@
  -        
  +
           <!-- For parent ComponentManager sample:
           org.apache.cocoon.samples.parentcm.Configurator
           -->
         </param-value>
       </init-param>
  -  
  -    <!-- 
  -      This parameter allows to specify where Cocoon should put files 
  -      which are uploaded by the upload.xsp sample. The path specified 
  -      is always relative to the context path of the servlet. 
  +
  +    <!--
  +      This parameter allows to specify where Cocoon should put files
  +      which are uploaded by the upload.xsp sample. The path specified
  +      is always relative to the context path of the servlet.
         The default directory is "upload-dir" in the work-directory
   
       <init-param>
  @@ -137,10 +137,10 @@
       </init-param>
       -->
   
  -    <!-- 
  -      This parameter allows to specify where Cocoon should put files 
  -      which are cached by the storing class. The path specified 
  -      is always relative to the context path of the servlet. 
  +    <!--
  +      This parameter allows to specify where Cocoon should put files
  +      which are cached by the storing class. The path specified
  +      is always relative to the context path of the servlet.
         The default directory is "cache-dir" in the work-directory
   
       <init-param>
  @@ -148,11 +148,11 @@
         <param-value>/WEB-INF/work/cache-dir</param-value>
       </init-param>
       -->
  -  
  -    <!-- 
  +
  +    <!--
         This parameter allows to specify where Cocoon should put it's
  -      working files. The path specified is always relative to the 
  -      context path of the Cocoon servlet. 
  +      working files. The path specified is always relative to the
  +      context path of the Cocoon servlet.
         Usually it is obtained from the servlet engine.
   
       <init-param>
  @@ -183,8 +183,8 @@
   
         Cocoon honors the Loggable and Initializable interfaces for this class,
         if it implements them.
  -    
  -      If you uncomment the following lines the parent CM is set to the Parent CM sample,
which will look up 
  +
  +      If you uncomment the following lines the parent CM is set to the Parent CM sample,
which will look up
         a configuration via JNDI at org/apache/cocoon/samples/parentcm/ParentCMConfiguration
         and use it.
       <init-param>
  @@ -193,7 +193,15 @@
       </init-param>
       -->
   
  -    <!-- 
  +    <!--
  +      This parameter allows you to select the request factory.
  +    -->
  +    <init-param>
  +      <param-name>request-factory</param-name>
  +      <param-value>org.apache.cocoon.components.request.MaybeUploadRequestFactoryImpl</param-value>
  +    </init-param>
  +
  +    <!--
         If you set this parameter to 'true' or 'yes', Cocoon will add processing
         time to the end of each response. Value 'hide' adds processing time as an HTML
         comment. By default, processing time is not added (corresponds to value 'no').
  @@ -214,15 +222,15 @@
     <!--
       Cocoon handles all the URL space assigned to the webapp using its sitemap.
       It is recommended to leave it unchanged. Under some circumstances though
  -    (like integration with proprietary webapps or servlets) you might have 
  +    (like integration with proprietary webapps or servlets) you might have
       to change this parameter.
     -->
     <servlet-mapping>
       <servlet-name>Cocoon2</servlet-name>
       <url-pattern>/</url-pattern>
     </servlet-mapping>
  -  <!-- 
  -    Some servlet engines (Tomcat) have defaults which are not overriden 
  +  <!--
  +    Some servlet engines (Tomcat) have defaults which are not overriden
       by '/' mapping, but must be overriden explicitly.
     -->
     <servlet-mapping>
  
  
  

----------------------------------------------------------------------
In case of troubles, e-mail:     webmaster@xml.apache.org
To unsubscribe, e-mail:          cocoon-cvs-unsubscribe@xml.apache.org
For additional commands, e-mail: cocoon-cvs-help@xml.apache.org


Mime
View raw message