tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cos...@locus.apache.org
Subject cvs commit: jakarta-tomcat/src/share/org/apache/tomcat/request AccessInterceptor.java SimpleMapper1.java
Date Thu, 29 Jun 2000 18:01:46 GMT
costin      00/06/29 11:01:43

  Modified:    .        build.xml
               src/examples/WEB-INF web.xml
               src/share/org/apache/tomcat/core RequestImpl.java
               src/share/org/apache/tomcat/request AccessInterceptor.java
                        SimpleMapper1.java
  Log:
  Minor fixes:
  - added optimize flag
  - 80 col indentations :-)
  - don't include j2ee adapter in webserver.jar, make it a separate jar ( previous
  release of tomcat had it inside ) .
  - FORM login for examples - it seems to work fine ( it is a feature that we should
  support and is implemented )
  - AccessInterceptor used to give bad warnings. We still detect pages starting with
  cpath and work around, plus warn about it ( pet store will be fixed, but other may have
  this problem )
  - removed debug trace in mapper
  
  Revision  Changes    Path
  1.52      +34 -8     jakarta-tomcat/build.xml
  
  Index: build.xml
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat/build.xml,v
  retrieving revision 1.51
  retrieving revision 1.52
  diff -u -r1.51 -r1.52
  --- build.xml	2000/06/26 18:01:26	1.51
  +++ build.xml	2000/06/29 18:01:21	1.52
  @@ -5,10 +5,12 @@
            work  -->
       <property name="ant.home" value="../jakarta-ant" />
       <property name="build.compiler" value="classic"/>
  -    <property name="servlet.jar" value="../jakarta-servletapi/lib/servlet.jar"/>
  +    <property name="servlet.jar" 
  +              value="../jakarta-servletapi/lib/servlet.jar"/>
       <property name="tomcat.build" value="../build/tomcat"/>
       <property name="tomcat.home" value="../dist/tomcat"/>
       <property name="j2ee.home" value="../../j2ee/build/unix"/>
  +    <property name="optimize" value="true" />
     </target>
   
     <!-- ==================== Copy static files ==================== -->
  @@ -33,12 +35,14 @@
       <copyfile src="build.xml" dest="${tomcat.build}/conf/build.xml"/>
       <mkdir dir="${tomcat.build}/lib/test"/>
       <mkdir dir="${tomcat.build}/lib/test/Golden"/>
  -    <copydir src="src/tests/share/tests/jsp/Golden" dest="${tomcat.build}/lib/test/Golden"/>
  +    <copydir src="src/tests/share/tests/jsp/Golden" 
  +             dest="${tomcat.build}/lib/test/Golden"/>
   
       <!-- include ant, it is used for testing and will be used for
            configuration and few other tasks -->
       <copydir src="${ant.home}/bin" dest="${tomcat.build}/bin"/>
  -    <copyfile src="${ant.home}/lib/ant.jar" dest="${tomcat.build}/lib/ant.jar"/>
  +    <copyfile src="${ant.home}/lib/ant.jar" 
  +              dest="${tomcat.build}/lib/ant.jar"/>
       <copyfile src="${servlet.jar}" dest="${tomcat.build}/lib/servlet.jar"/>
       <copyfile src="LICENSE" dest="${tomcat.build}/LICENSE"/>
   
  @@ -63,6 +67,7 @@
       <javac srcdir="src/share" destdir="${tomcat.build}/classes"
              classpath="${servlet.jar}" 
              debug="on" 
  +           optimize="${optimize}"
              deprecation="off" >
              <exclude name="**/Jdk12Interceptor.java" 
                       unless="jdk12.present"/>
  @@ -89,6 +94,7 @@
     <!-- Build J2EE integration code -->
     <target name="j2ee" depends="tomcat">
         <javac srcdir="src/j2ee" 
  +          optimize="${optimize}"
             destdir="${tomcat.build}/classes"
             classpath="${servlet.jar};${j2ee.home}/lib/classes;${j2ee.home}/lib/j2ee.jar"

             debug="on" />
  @@ -104,15 +110,18 @@
       <mkdir dir="${tomcat.build}/webapps/examples"/>
       <copydir src="src/examples" dest="${tomcat.build}/webapps/examples"/>
       <javac srcdir="src/examples/WEB-INF/classes"
  +           optimize="${optimize}"
              destdir="${tomcat.build}/webapps/examples/WEB-INF/classes"
              classpath="${tomcat.build}/classes;${servlet.jar}"/>
       <javac srcdir="src/examples/jsp/plugin/applet"
  +           optimize="${optimize}"
              destdir="${tomcat.build}/webapps/examples/jsp/plugin/applet"/>
   
       <!-- Root context -->
       <mkdir dir="${tomcat.build}/webapps/ROOT"/>
       <copydir src="src/webpages" dest="${tomcat.build}/webapps/ROOT"/>
       <javac srcdir="src/webpages/WEB-INF/classes"
  +           optimize="${optimize}"
              destdir="${tomcat.build}/webapps/ROOT/WEB-INF/classes"
              classpath="${tomcat.build}/classes;${servlet.jar}"/>
   
  @@ -120,6 +129,7 @@
       <mkdir dir="${tomcat.build}/webapps/admin"/>
       <copydir src="src/admin" dest="${tomcat.build}/webapps/admin"/>
       <javac srcdir="src/admin/WEB-INF/classes"
  +           optimize="${optimize}"
              destdir="${tomcat.build}/webapps/admin/WEB-INF/classes"
              classpath="${tomcat.build}/classes;${servlet.jar}"/>
   
  @@ -127,12 +137,13 @@
       <mkdir dir="${tomcat.build}/webapps/test"/>
       <copydir src="src/tests/webpages" dest="${tomcat.build}/webapps/test"/>
       <javac srcdir="src/tests/webpages/WEB-INF/classes"
  +           optimize="${optimize}"
              destdir="${tomcat.build}/webapps/test/WEB-INF/classes"
              classpath="${tomcat.build}/classes;${servlet.jar}"/>
     </target>
   
   
  -  <!-- ==================== Copy the files to distribution format ====================
-->
  +  <!-- ==================== Copy the files to distribution format ======== -->
     <target name="dist" depends="main,webapps">
   
       <mkdir dir="${tomcat.home}"/>
  @@ -141,8 +152,13 @@
   
       <!-- create tomcat jar files -->
       <jar jarfile="${tomcat.home}/lib/webserver.jar"
  -         basedir="${tomcat.home}/classes"
  -         includes="org/apache/tomcat/**"/> 
  +         basedir="${tomcat.build}/classes" >
  +         <include name="org/apache/tomcat/**" />
  +         <exclude name="org/apache/tomcat/deployment/**" />
  +         <exclude name="org/apache/tomcat/j2ee/**" />
  +         <exclude name="org/apache/tomcat/util/XMLParser.class" />
  +         <exclude name="org/apache/tomcat/util/XMLTree.class" />
  +    </jar> 
       <jar jarfile="${tomcat.home}/lib/jasper.jar"
            basedir="${tomcat.home}/classes"
            includes="org/apache/jasper/**"/>
  @@ -191,13 +207,23 @@
       <chmod perm="+x" src="${tomcat.home}/bin/startup.sh"/>
       <chmod perm="+x" src="${tomcat.home}/bin/shutdown.sh"/>
       <chmod perm="+x" src="${tomcat.home}/bin/test-tomcat.sh"/>
  +  </target>
  +
  +  <target name="j2ee-dist" depends="j2ee"> 
  +    <jar jarfile="${tomcat.home}/lib/tomcat-j2ee.jar"
  +         basedir="${tomcat.build}/classes" >
  +         <include name="org/apache/tomcat/deployment/**" />
  +         <include name="org/apache/tomcat/j2ee/**" />
  +         <include name="org/apache/tomcat/util/XMLParser.class" />
  +         <include name="org/apache/tomcat/util/XMLTree.class" />
  +    </jar> 
     </target>
  - 
     <!-- =================================================================== -->
     <!-- Packages the distribution with ZIP                                  -->
     <!-- =================================================================== -->
     <target name="dist-zip" depends="dist">
  -    <zip zipfile="${Name}-${version}.zip" basedir="${tomcat.home}" includes="**"/>
  +    <zip zipfile="${Name}-${version}.zip" basedir="${tomcat.home}" 
  +         includes="**"/>
     </target>
   
     
  
  
  
  1.10      +3 -3      jakarta-tomcat/src/examples/WEB-INF/web.xml
  
  Index: web.xml
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat/src/examples/WEB-INF/web.xml,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- web.xml	2000/04/07 22:59:00	1.9
  +++ web.xml	2000/06/29 18:01:27	1.10
  @@ -80,25 +80,25 @@
       </security-constraint>
   
       <!-- Default login configuration uses BASIC authentication -->
  +    <!--
       <login-config>
         <auth-method>BASIC</auth-method>
         <realm-name>Example Basic Authentication Area</realm-name>
       </login-config>
  +    -->
   
       <!-- If you want to experiment with form-based logins, comment
            out the <login-config> element above and replace it with
            this one.  Note that we are currently using a nonstandard
            authentication method, because the code to support form
            based login is incomplete and only lightly tested.  -->
  -    <!--
       <login-config>
  -      <auth-method>EXPERIMENTAL_FORM</auth-method>
  +      <auth-method>FORM</auth-method>
         <realm-name>Example Form-Based Authentication Area</realm-name>
         <form-login-config>
           <form-login-page>/jsp/security/login/login.jsp</form-login-page>
           <form-error-page>/jsp/security/login/error.jsp</form-error-page>
         </form-login-config>
       </login-config>
  -    -->
   
   </web-app>
  
  
  
  1.52      +1 -1      jakarta-tomcat/src/share/org/apache/tomcat/core/RequestImpl.java
  
  Index: RequestImpl.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/core/RequestImpl.java,v
  retrieving revision 1.51
  retrieving revision 1.52
  diff -u -r1.51 -r1.52
  --- RequestImpl.java	2000/06/22 19:49:35	1.51
  +++ RequestImpl.java	2000/06/29 18:01:30	1.52
  @@ -386,7 +386,7 @@
   	String checkRoles[]=new String[1];
   	checkRoles[0]=role;
   	int status=contextM.doAuthorize(this, response, checkRoles);
  -	return status==200;
  +	return status==0;
       }
   
       public String getServletPath() {
  
  
  
  1.12      +10 -10    jakarta-tomcat/src/share/org/apache/tomcat/request/AccessInterceptor.java
  
  Index: AccessInterceptor.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/request/AccessInterceptor.java,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- AccessInterceptor.java	2000/06/22 19:49:38	1.11
  +++ AccessInterceptor.java	2000/06/29 18:01:35	1.12
  @@ -152,20 +152,20 @@
   	    String cpath=ctx.getPath();
   	    
   	    // Workaround for common error - ctx path included
  -	    if( ! page.startsWith( cpath ) )
  -		page= cpath + page;
  -	    else
  -		if( ! "/".equals(cpath))
  +	    if( page.startsWith( cpath ) ) {
  +		if( ! ("".equals(cpath) || "/".equals(cpath)) )
   		    ctx.log("FORM: WARNING, login page starts with " +
  -			    "context path " + page);
  -	    
  +			    "context path " + page + " " + cpath );
  +	    } else
  +		page= cpath + page;
   
  -	    if( ! errorPage.startsWith( cpath ) )
  -		errorPage= cpath + errorPage;
  -	    else
  -		if( ! "/".equals(cpath))
  +
  +	    if( errorPage.startsWith( cpath ) ) {
  +		if( ! ("/".equals(cpath) || "".equals( cpath )) )
   		    ctx.log("FORM: WARNING, error page starts with " +
   			    "context path " + errorPage);
  +	    } else
  +		errorPage= cpath + errorPage;
   
   	    // Adjust login and error paths - avoid computations in handlers
   	    ctx.setFormLoginPage( page );
  
  
  
  1.15      +2 -2      jakarta-tomcat/src/share/org/apache/tomcat/request/SimpleMapper1.java
  
  Index: SimpleMapper1.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/request/SimpleMapper1.java,v
  retrieving revision 1.14
  retrieving revision 1.15
  diff -u -r1.14 -r1.15
  --- SimpleMapper1.java	2000/06/28 20:37:08	1.14
  +++ SimpleMapper1.java	2000/06/29 18:01:36	1.15
  @@ -402,8 +402,8 @@
   	    // For exact matching - can't have path info ( or it's 
   	    // a prefix map )
   	    //path.substring( ctxPLen + sLen , pathLen);
  -	    /*DEBUG*/ try {throw new Exception(); } catch(Exception ex) {ex.printStackTrace();}
  -	    if( debug>0 ) log( "Adjust for path map " + s + " " + pathI + container.getPath());
  +	    if( debug>0 ) log( "Adjust for path map " +
  +			       s + " " + pathI + container.getPath());
   	    break; // keep the path
   	case Container.EXTENSION_MAP:
   	    /*  adjust paths */
  
  
  

Mime
View raw message