billbarker    2004/10/03 11:01:52

  Modified:    src/share/org/apache/tomcat/core Request.java
               src/share/org/apache/tomcat/modules/mappers
                        CoyoteMapper.java
  Log:
  Integrate the MappingData with the Request.
  
  Revision  Changes    Path
  1.120     +11 -1     jakarta-tomcat/src/share/org/apache/tomcat/core/Request.java
  
  Index: Request.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/core/Request.java,v
  retrieving revision 1.119
  retrieving revision 1.120
  diff -u -r1.119 -r1.120
  --- Request.java      25 Feb 2004 06:45:07 -0000      1.119
  +++ Request.java      3 Oct 2004 18:01:52 -0000       1.120
  @@ -30,6 +30,7 @@
   import org.apache.tomcat.util.http.Cookies;
   import org.apache.tomcat.util.http.MimeHeaders;
   import org.apache.tomcat.util.http.Parameters;
  +import org.apache.tomcat.util.http.mapper.MappingData;
   
   /**
    * This is a low-level, efficient representation of a server request. Most fields
  @@ -155,6 +156,7 @@
       protected ContextManager contextM;
       protected Context context;
       protected Object requestFacade;
  +    protected MappingData mappingData = null;
   
       // Session
       protected String reqSessionId;
  @@ -352,6 +354,14 @@
        this.localHost = host;
       }
   
  +    public MappingData getMappingData() {
  +     if(mappingData == null) {
  +         mappingData = new MappingData();
  +         mappingData.wrapperPath = servletPathMB;
  +         mappingData.pathInfo = pathInfoMB;
  +     }
  +     return mappingData;
  +    }
   
       // -------------------- Parameters --------------------
   
  @@ -1045,7 +1055,7 @@
        scookies.recycle();
        
           for( int i=0; i<ContextManager.MAX_NOTES; i++ ) notes[i]=null;
  -
  +     
        // sub-req
        parent=null;
        child=null;
  
  
  
  1.2       +7 -7      
jakarta-tomcat/src/share/org/apache/tomcat/modules/mappers/CoyoteMapper.java
  
  Index: CoyoteMapper.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/modules/mappers/CoyoteMapper.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- CoyoteMapper.java 22 Aug 2004 23:49:20 -0000      1.1
  +++ CoyoteMapper.java 3 Oct 2004 18:01:52 -0000       1.2
  @@ -56,8 +56,8 @@
   public class CoyoteMapper extends  BaseInterceptor  {
   
       public static final String DEFAULT_HOST = "DEFAULT";
  -    Mapper map;
  -    Hashtable hostData = new Hashtable();
  +    private Mapper map;
  +    private Hashtable hostData = new Hashtable();
   
       public CoyoteMapper() {
       }
  @@ -190,13 +190,13 @@
            // This is a sub-request for the default host.
            hostMB.setString(DEFAULT_HOST);
        }
  -     MappingData mdata = new MappingData();
  -     mdata.wrapperPath = req.servletPath();
  -     mdata.pathInfo = req.pathInfo();
  +     MappingData mdata = req.getMappingData();
  +     mdata.recycle();
        try {
            map.map(hostMB, pathMB, mdata);
        } catch(Exception ex) {
            log("Error mapping "+pathMB,ex);
  +         req.getResponse().setErrorException(ex);
            return 500;
        }
        if(mdata.context != null) {
  @@ -206,9 +206,9 @@
            req.setContainer( container );
            if(!mdata.redirectPath.isNull()) {
                Response res = req.getResponse();
  -             if(debug > 0)
  +             if(debug > 9)
                    log("Redirecting '"+req+"' to '"+
  -                     mdata.redirectPath+"'", new Exception());
  +                     mdata.redirectPath+"'");
                res.setHeader("Location", mdata.redirectPath.toString());
                return 302;
            } 
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to