You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@cocoon.apache.org by gi...@locus.apache.org on 2000/12/05 23:02:07 UTC

cvs commit: xml-cocoon/src/org/apache/cocoon/environment/commandline CommandLineRequest.java CommandLineResponse.java

giacomo     00/12/05 14:02:06

  Modified:    .        Tag: xml-cocoon2 build.xml
               src/org/apache/cocoon/environment/commandline Tag:
                        xml-cocoon2 CommandLineRequest.java
                        CommandLineResponse.java
  Added:       src/org/apache/cocoon/environment/http Tag: xml-cocoon2
                        HttpRequest22.java HttpResponse22.java
                        HttpRequest23.java HttpResponse23.java
  Removed:     src/org/apache/cocoon/environment/http Tag: xml-cocoon2
                        HttpRequest.java HttpResponse.java
  Log:
  Added capability to correctly implement various classes dependant wether there is a servlet22 or a servlet23 jar in the classpath/lib directory
  
  Revision  Changes    Path
  No                   revision
  
  
  No                   revision
  
  
  1.6.2.47  +41 -4     xml-cocoon/build.xml
  
  Index: build.xml
  ===================================================================
  RCS file: /home/cvs/xml-cocoon/build.xml,v
  retrieving revision 1.6.2.46
  retrieving revision 1.6.2.47
  diff -u -r1.6.2.46 -r1.6.2.47
  --- build.xml	2000/12/02 13:24:50	1.6.2.46
  +++ build.xml	2000/12/05 22:01:55	1.6.2.47
  @@ -188,6 +188,10 @@
       <available property="tidy.present" classname="org.w3c.tidy.Tidy">
         <classpath refid="classpath"/>
       </available>
  +    <available property="servlet23.present"
  +        classname="javax.servlet.http.HttpServletRequestWrapper">
  +      <classpath refid="classpath"/>
  +    </available>
     </target>
   
     <!-- =================================================================== -->
  @@ -200,15 +204,47 @@
     <!-- =================================================================== -->
     <!-- Prepares the source code                                            -->
     <!-- =================================================================== -->
  -  <target name="prepare-src" depends="prepare">
  +  <target name="prepare-src-main" depends="prepare">
       <mkdir dir="${build.src}"/>
       <mkdir dir="${build.dest}"/>
       <copy todir="${build.src}" filtering="on">
  -      <fileset dir="${src.dir}"/>
  -    </copy>    
  +      <fileset dir="${src.dir}">
  +        <exclude name="**/http/HttpRequest2*.java"/>
  +        <exclude name="**/http/HttpResponse2*.java"/>
  +      </fileset>
  +    </copy>
  +  </target>
  +
  +  <!-- =================================================================== -->
  +  <!-- Prepares the servlet 2.3 source code                                -->
  +  <!-- =================================================================== -->
  +  <target name="prepare-src-23" depends="prepare-src-main" if="servlet23.present">
  +    <copy file="${src.dir}/org/apache/cocoon/environment/http/HttpRequest23.java"
  +        tofile="${build.src}/org/apache/cocoon/environment/http/HttpRequest.java"
  +        filtering="on"/>
  +    <copy file="${src.dir}/org/apache/cocoon/environment/http/HttpResponse23.java"
  +        tofile="${build.src}/org/apache/cocoon/environment/http/HttpResponse.java"
  +        filtering="on"/>
     </target>
   
     <!-- =================================================================== -->
  +  <!-- Prepares the servlet 2.2 source code                                -->
  +  <!-- =================================================================== -->
  +  <target name="prepare-src-22" depends="prepare-src-23" unless="servlet23.present">
  +    <copy file="${src.dir}/org/apache/cocoon/environment/http/HttpRequest22.java"
  +        tofile="${build.src}/org/apache/cocoon/environment/http/HttpRequest.java"
  +        filtering="on"/>
  +    <copy file="${src.dir}/org/apache/cocoon/environment/http/HttpResponse22.java"
  +        tofile="${build.src}/org/apache/cocoon/environment/http/HttpResponse.java"
  +        filtering="on"/>
  +  </target>
  +
  +  <!-- =================================================================== -->
  +  <!-- Prepares the source code                                            -->
  +  <!-- =================================================================== -->
  +  <target name="prepare-src" depends="prepare-src-22"/>
  +
  +  <!-- =================================================================== -->
     <!-- Compiles the source directory                                       -->
     <!-- =================================================================== -->
     <target name="compile" depends="prepare-src" description="Compiles the source code">
  @@ -282,9 +318,10 @@
           <include name="*.jar"/>
           <exclude name="ant*.jar"/>
           <exclude name="stylebook*.jar"/>
  +        <!-- <exclude name="servlet*.jar"/> -->
         </fileset>
       </copy>
  -    
  +
       <!-- NOTE: java.home is normally set by the JVM to the /jre directory -->
       <copy file="${java.home}/../lib/tools.jar" tofile="${build.war}/WEB-INF/lib/javac.jar"/>
       <copy file="${build.dir}/${name}.jar" tofile="${build.war}/WEB-INF/lib/${name}-${version}.jar"/>
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.1.2.1   +246 -0    xml-cocoon/src/org/apache/cocoon/environment/http/Attic/HttpRequest22.java
  
  
  
  
  1.1.2.1   +173 -0    xml-cocoon/src/org/apache/cocoon/environment/http/Attic/HttpResponse22.java
  
  
  
  
  1.1.2.1   +53 -0     xml-cocoon/src/org/apache/cocoon/environment/http/Attic/HttpRequest23.java
  
  
  
  
  1.1.2.1   +47 -0     xml-cocoon/src/org/apache/cocoon/environment/http/Attic/HttpResponse23.java
  
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.1.2.6   +3 -3      xml-cocoon/src/org/apache/cocoon/environment/commandline/Attic/CommandLineRequest.java
  
  Index: CommandLineRequest.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon/src/org/apache/cocoon/environment/commandline/Attic/CommandLineRequest.java,v
  retrieving revision 1.1.2.5
  retrieving revision 1.1.2.6
  diff -u -r1.1.2.5 -r1.1.2.6
  --- CommandLineRequest.java	2000/12/03 13:56:33	1.1.2.5
  +++ CommandLineRequest.java	2000/12/05 22:02:02	1.1.2.6
  @@ -29,7 +29,7 @@
    * Creates a specific servlet request simulation from command line usage.
    *
    * @author <a href="mailto:stefano@apache.org">Stefano Mazzocchi</a>
  - * @version CVS $Revision: 1.1.2.5 $ $Date: 2000/12/03 13:56:33 $
  + * @version CVS $Revision: 1.1.2.6 $ $Date: 2000/12/05 22:02:02 $
    */
   
   /*
  @@ -93,7 +93,7 @@
       public String getQueryString() { return null; } // use parameters instead
       public String getPathTranslated() { return null; } // FIXME (SM) this is legal but should we do something more?
   
  -    public Object getAttribute(String name) { 
  +    public Object getAttribute(String name) {
           return (attributes != null) ? attributes.get(name) : null;
       }
       public Enumeration getAttributeNames() { 
  @@ -102,7 +102,7 @@
       public void setAttribute(String name, Object value) { 
           if (attributes != null) attributes.put(name, value);
       }
  -    public void removeAttribute(String name) { 
  +    public void removeAttribute(String name) {
           if (attributes != null) attributes.remove(name);
       }
   
  
  
  
  1.1.2.5   +4 -4      xml-cocoon/src/org/apache/cocoon/environment/commandline/Attic/CommandLineResponse.java
  
  Index: CommandLineResponse.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon/src/org/apache/cocoon/environment/commandline/Attic/CommandLineResponse.java,v
  retrieving revision 1.1.2.4
  retrieving revision 1.1.2.5
  diff -u -r1.1.2.4 -r1.1.2.5
  --- CommandLineResponse.java	2000/12/03 13:56:34	1.1.2.4
  +++ CommandLineResponse.java	2000/12/05 22:02:03	1.1.2.5
  @@ -22,7 +22,7 @@
    * Creates a specific servlet response simulation from command line usage.
    *
    * @author <a href="mailto:stefano@apache.org">Stefano Mazzocchi</a>
  - * @version CVS $Revision: 1.1.2.4 $ $Date: 2000/12/03 13:56:34 $
  + * @version CVS $Revision: 1.1.2.5 $ $Date: 2000/12/05 22:02:03 $
    */
   
   public class CommandLineResponse implements HttpServletResponse {
  @@ -58,13 +58,13 @@
       public void addDateHeader(String name, long date) { }
       public void addHeader(String name, String value) { }
       public void addIntHeader(String name, int value) { }
  -    
  +
       /** @deprecated */
       public void setStatus(int sc, String sm) {}
       /** @deprecated */
       public String encodeUrl(String url) { return url; }
       /** @deprecated */
       public String encodeRedirectUrl(String url) { return url; }
  -    public java.lang.StringBuffer getRequestURL() { return null; }
  -    public void resetBuffer() { }
  +
  +    public void resetBuffer() {};
   }