tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cos...@hyperreal.org
Subject cvs commit: jakarta-tomcat/src/share/org/apache/tomcat/core Container.java Context.java LookupResult.java
Date Sat, 06 Nov 1999 00:07:33 GMT
costin      99/11/05 16:07:33

  Modified:    src/share/org/apache/tomcat/core Container.java Context.java
                        LookupResult.java
  Log:
  Cleaning up the execution path.
  Needed in order to enable Apache hints, and for better readability.
  
  - setters in LookupResult ( to enable object reuse )
  
  Revision  Changes    Path
  1.4       +4 -0      jakarta-tomcat/src/share/org/apache/tomcat/core/Container.java
  
  Index: Container.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/core/Container.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- Container.java	1999/11/05 18:36:30	1.3
  +++ Container.java	1999/11/06 00:07:32	1.4
  @@ -332,6 +332,10 @@
           return lookupResult;
       }
   
  +    ServletWrapper lookupServlet(String servletName) {
  +	return (ServletWrapper)servlets.get(servletName);
  +    }
  +
       LookupResult lookupServletAndLoadByName(String servletName) {
   	// XXX
   	// make sure that we aren't tramping over ourselves!
  
  
  
  1.9       +7 -4      jakarta-tomcat/src/share/org/apache/tomcat/core/Context.java
  
  Index: Context.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/core/Context.java,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- Context.java	1999/11/05 18:36:31	1.8
  +++ Context.java	1999/11/06 00:07:32	1.9
  @@ -954,11 +954,14 @@
   
   	    while (e.hasMoreElements()) {
   		String servletName = (String)e.nextElement();
  -		LookupResult result =
  -		    container.lookupServletByName(servletName);
  -
  +		ServletsWrapper  result = container.getServletByName(servletName);
  +		
  +		if(result==null)
  +		    System.out.println("Warning: we try to load an undefined servlet " + servletName);
  +		
   		try {
  -		    result.getWrapper().loadServlet();
  +		    if(result!=null)
  +			result.loadServlet();
   		} catch (Exception ee) {
   		    String msg = sm.getString("context.loadServlet.e",
   		        servletName);
  
  
  
  1.3       +28 -0     jakarta-tomcat/src/share/org/apache/tomcat/core/LookupResult.java
  
  Index: LookupResult.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/core/LookupResult.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- LookupResult.java	1999/11/05 18:36:33	1.2
  +++ LookupResult.java	1999/11/06 00:07:32	1.3
  @@ -74,6 +74,9 @@
       private String pathInfo = null;
       private String resolvedServlet = null;
   
  +    LookupResult() {
  +    }
  +    
       LookupResult(ServletWrapper wrapper, String servletPath,
           String pathInfo) {
           this(wrapper, servletPath, null, pathInfo, null);
  @@ -96,20 +99,45 @@
       ServletWrapper getWrapper() {
   	return wrapper;
       }
  +    
  +    void setWrapper(ServletWrapper wrapper) {
  +	this.wrapper=wrapper;
  +    }
   
       String getServletPath() {
   	return servletPath;
       }
   
  +    void setServletPath( String p ) {
  +	servletPath=p;
  +    }
  +
       String getMappedPath() {
   	return mappedPath;
       }
   
  +    void setMappedPath( String m ) {
  +	mappedPath=m;
  +    }
  +
       String getPathInfo() {
   	return pathInfo;
       }
   
  +    void setPathInfo( String pi ) {
  +	pathInfo=pi;
  +    }
  +    
       String getResolvedServlet() {
   	return resolvedServlet;
  +    }
  +
  +    void setResolvedServlet(String rs ) {
  +	resolvedServlet=rs;
  +    }
  +
  +    public String toString() {
  +	return "LookupResult( SP=" + servletPath + " PI=" + pathInfo + " MP="+mappedPath
  +	    + " RS=" + resolvedServlet + " SW=" + wrapper + ")";
       }
   }
  
  
  

Mime
View raw message