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/facade23/org/apache/tomcat/facade23 HttpServletRequestFacade.java HttpServletResponseFacade.java RequestDispatcherImpl.java ServletWrapper.java
Date Thu, 02 Nov 2000 21:51:47 GMT
costin      00/11/02 13:51:47

  Modified:    src/facade22/org/apache/tomcat/facade
                        HttpServletRequestFacade.java
                        HttpServletResponseFacade.java
                        RequestDispatcherImpl.java
                        Servlet22Interceptor.java ServletWrapper.java
               src/facade22/org/apache/tomcat/modules/facade22
                        JspInterceptor.java
               src/facade23/org/apache/tomcat/facade23
                        HttpServletRequestFacade.java
                        HttpServletResponseFacade.java
                        RequestDispatcherImpl.java ServletWrapper.java
  Log:
  - Changes required to support String->MessageBytes and other core changes.
  
  JspInterceptor now supports jikes :-) !!
  ( you need to enable it with compiler="jikes" - and it's fast !)
  
  Revision  Changes    Path
  1.8       +4 -4      jakarta-tomcat/src/facade22/org/apache/tomcat/facade/HttpServletRequestFacade.java
  
  Index: HttpServletRequestFacade.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat/src/facade22/org/apache/tomcat/facade/HttpServletRequestFacade.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- HttpServletRequestFacade.java	2000/10/08 21:28:56	1.7
  +++ HttpServletRequestFacade.java	2000/11/02 21:51:34	1.8
  @@ -224,7 +224,7 @@
       }
       
       public String getMethod() {
  -        return request.getMethod();
  +        return request.method().toString();
       }
   
       /** Adapter: Request doesn't deal with this servlet convention
  @@ -263,7 +263,7 @@
       }
   
       public String getQueryString() {
  -        return request.getQueryString();
  +        return request.queryString().toString();
       }
   
       public String getRemoteUser() {
  @@ -271,7 +271,7 @@
       }
   
       public String getScheme() {
  -        return request.getScheme();
  +        return request.scheme().toString();
       }
   
       public String getServerName() {
  @@ -320,7 +320,7 @@
       }
   
       public String getRequestURI() {
  -        return request.getRequestURI();
  +        return request.requestURI().toString();
       }
   
       /** Facade: we delegate to the right object ( the context )
  
  
  
  1.8       +1 -1      jakarta-tomcat/src/facade22/org/apache/tomcat/facade/HttpServletResponseFacade.java
  
  Index: HttpServletResponseFacade.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat/src/facade22/org/apache/tomcat/facade/HttpServletResponseFacade.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- HttpServletResponseFacade.java	2000/10/27 20:50:50	1.7
  +++ HttpServletResponseFacade.java	2000/11/02 21:51:37	1.8
  @@ -364,7 +364,7 @@
   	}
   
   	// Does this URL match down to (and including) the context path?
  -	if (!request.getScheme().equalsIgnoreCase(url.getProtocol()))
  +	if (!request.scheme().equalsIgnoreCase(url.getProtocol()))
   	    return (false);
   	if (!request.getServerName().equalsIgnoreCase(url.getHost()))
   	    return (false);
  
  
  
  1.4       +3 -3      jakarta-tomcat/src/facade22/org/apache/tomcat/facade/RequestDispatcherImpl.java
  
  Index: RequestDispatcherImpl.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat/src/facade22/org/apache/tomcat/facade/RequestDispatcherImpl.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- RequestDispatcherImpl.java	2000/09/28 03:25:44	1.3
  +++ RequestDispatcherImpl.java	2000/11/02 21:51:37	1.4
  @@ -168,7 +168,7 @@
   	// set the context - no need to fire context parsing again
   	realRequest.setContext( context );
   
  -	realRequest.setRequestURI( context.getPath() + path );
  +	realRequest.requestURI().setString( context.getPath() + path );
   
   	// merge query string as specified in specs - before, it may affect
   	// the way the request is handled by special interceptors
  @@ -187,7 +187,7 @@
   
   
   	// CM should have set the wrapper - call it
  -	Handler wr=realRequest.getWrapper();
  +	Handler wr=realRequest.getHandler();
   	if( wr!=null ) wr.service(realRequest, realResponse);
   
   	// close the response - output after this point will be discarded.
  @@ -312,7 +312,7 @@
    	// now it's really strange: we call the wrapper on the subrequest
   	// for the realRequest ( since the real request will still have the
   	// original handler/wrapper )
  -	Handler wr=subRequest.getWrapper();
  +	Handler wr=subRequest.getHandler();
   	if( wr!=null ) wr.service(realRequest, realResponse);
   
   	// After request, we want to restore the include attributes - for
  
  
  
  1.5       +20 -1     jakarta-tomcat/src/facade22/org/apache/tomcat/facade/Servlet22Interceptor.java
  
  Index: Servlet22Interceptor.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat/src/facade22/org/apache/tomcat/facade/Servlet22Interceptor.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- Servlet22Interceptor.java	2000/10/01 06:37:42	1.4
  +++ Servlet22Interceptor.java	2000/11/02 21:51:39	1.5
  @@ -105,7 +105,26 @@
   	ctx.setEngineHeader( engineHeader );
       }
   
  -
  +    /** Call servlet.destroy() for all servlets, as required
  +	by the spec
  +    */
  +    public void contextShutdown( Context ctx )
  +	throws TomcatException
  +    {
  +	// shut down and servlets
  +	Enumeration enum = ctx.getServletNames();
  +	while (enum.hasMoreElements()) {
  +	    String key = (String)enum.nextElement();
  +	    Handler wrapper = ctx.getServletByName( key );
  +	    ctx.removeServletByName( key );
  +	    try {
  +		wrapper.destroy();
  +	    } catch(Exception ex ) {
  +		ctx.log( "Error in destroy ", ex);
  +	    }
  +	}
  +    }
  +    
       public void addContext( ContextManager cm, Context ctx )
   	throws TomcatException
       {
  
  
  
  1.9       +3 -2      jakarta-tomcat/src/facade22/org/apache/tomcat/facade/ServletWrapper.java
  
  Index: ServletWrapper.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat/src/facade22/org/apache/tomcat/facade/ServletWrapper.java,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- ServletWrapper.java	2000/10/01 06:37:42	1.8
  +++ ServletWrapper.java	2000/11/02 21:51:40	1.9
  @@ -252,7 +252,8 @@
   
   	    try {
   		if( servlet!=null) {
  -		    BaseInterceptor cI[]=contextM.getInterceptors(context.getContainer());
  +		    BaseInterceptor cI[]=context.
  +			getContainer().getInterceptors();
   		    for( int i=0; i< cI.length; i++ ) {
   			try {
   			    cI[i].preServletDestroy( context, this );
  @@ -323,7 +324,7 @@
   	//}
   
   	// Call pre, doInit and post
  -	BaseInterceptor cI[]=contextM.getInterceptors(context.getContainer());
  +	BaseInterceptor cI[]=context.getContainer().getInterceptors();
   	for( int i=0; i< cI.length; i++ ) {
   	    try {
   		cI[i].preServletInit( context, this );
  
  
  
  1.9       +18 -3     jakarta-tomcat/src/facade22/org/apache/tomcat/modules/facade22/JspInterceptor.java
  
  Index: JspInterceptor.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat/src/facade22/org/apache/tomcat/modules/facade22/JspInterceptor.java,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- JspInterceptor.java	2000/11/02 00:41:23	1.8
  +++ JspInterceptor.java	2000/11/02 21:51:44	1.9
  @@ -84,7 +84,22 @@
    */
   public class JspInterceptor extends BaseInterceptor {
       int jspInfoNOTE;
  +    TomcatOptions options=new TomcatOptions();
   
  +    static final String JIKES="org.apache.jasper.compiler.JikesJavaCompiler";
  +    
  +    public void setJavaCompiler( String type ) {
  +	// shortcut
  +	if( "jikes".equals( type ) )
  +	    type=JIKES;
  +	
  +	try {
  +	    options.jspCompilerPlugin=Class.forName(type);
  +	} catch(Exception ex ) {
  +	    ex.printStackTrace();
  +	}
  +    }
  +
       public void engineInit(ContextManager cm )
   	throws TomcatException
       {
  @@ -92,6 +107,7 @@
   	jspInfoNOTE=cm.getNoteId( ContextManager.HANDLER_NOTE,
   				  "tomcat.jspInfoNote");
       }
  +
       
       public void addContext(ContextManager cm, Context ctx)
   	throws TomcatException 
  @@ -119,7 +135,7 @@
       }
   
       public int requestMap( Request req ) {
  -	Handler wrapper=(Handler)req.getWrapper();
  +	Handler wrapper=(Handler)req.getHandler();
   
   	//	log( "Try: " + req );
   	
  @@ -208,7 +224,7 @@
   	    log("mapJspPage: request=" + req + ", jspInfo=" + jspInfo + ", servletName=" + servletName
+ ", classN=" + classN, ex);
   	    return ;
   	}
  -	req.setWrapper( wrapper );
  +	req.setHandler( wrapper );
   	if( debug>0) log("Wrapper " + wrapper);
       }
   
  @@ -225,7 +241,6 @@
       	    dir=new File( jspInfo.outputDir);
   	    dir.mkdirs();
   	    JspMangler mangler= new JspMangler(jspInfo);
  -	    TomcatOptions options=new TomcatOptions();
   	    JspEngineContext1 ctxt = new JspEngineContext1(req, mangler);
   	    ctxt.setOptions( options );
   	    
  
  
  
  1.7       +4 -4      jakarta-tomcat/src/facade23/org/apache/tomcat/facade23/HttpServletRequestFacade.java
  
  Index: HttpServletRequestFacade.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat/src/facade23/org/apache/tomcat/facade23/HttpServletRequestFacade.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- HttpServletRequestFacade.java	2000/10/08 21:28:56	1.6
  +++ HttpServletRequestFacade.java	2000/11/02 21:51:44	1.7
  @@ -233,7 +233,7 @@
       }
       
       public String getMethod() {
  -        return request.getMethod();
  +        return request.method().toString();
       }
   
       /** Adapter: Request doesn't deal with this servlet convention
  @@ -272,7 +272,7 @@
       }
   
       public String getQueryString() {
  -        return request.getQueryString();
  +        return request.queryString().toString();
       }
   
       public String getRemoteUser() {
  @@ -280,7 +280,7 @@
       }
   
       public String getScheme() {
  -        return request.getScheme();
  +        return request.scheme().toString();
       }
   
       public String getServerName() {
  @@ -328,7 +328,7 @@
       }
   
       public String getRequestURI() {
  -        return request.getRequestURI();
  +        return request.requestURI().toString();
       }
   
       /** Facade: we delegate to the right object ( the context )
  
  
  
  1.6       +4 -4      jakarta-tomcat/src/facade23/org/apache/tomcat/facade23/HttpServletResponseFacade.java
  
  Index: HttpServletResponseFacade.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat/src/facade23/org/apache/tomcat/facade23/HttpServletResponseFacade.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- HttpServletResponseFacade.java	2000/09/25 17:17:52	1.5
  +++ HttpServletResponseFacade.java	2000/11/02 21:51:45	1.6
  @@ -1,7 +1,7 @@
   /*
  - * $Header: /home/cvs/jakarta-tomcat/src/facade23/org/apache/tomcat/facade23/HttpServletResponseFacade.java,v
1.5 2000/09/25 17:17:52 costin Exp $
  - * $Revision: 1.5 $
  - * $Date: 2000/09/25 17:17:52 $
  + * $Header: /home/cvs/jakarta-tomcat/src/facade23/org/apache/tomcat/facade23/HttpServletResponseFacade.java,v
1.6 2000/11/02 21:51:45 costin Exp $
  + * $Revision: 1.6 $
  + * $Date: 2000/11/02 21:51:45 $
    *
    * ====================================================================
    *
  @@ -365,7 +365,7 @@
   	}
   
   	// Does this URL match down to (and including) the context path?
  -	if (!request.getScheme().equalsIgnoreCase(url.getProtocol()))
  +	if (!request.scheme().equalsIgnoreCase(url.getProtocol()))
   	    return (false);
   	if (!request.getServerName().equalsIgnoreCase(url.getHost()))
   	    return (false);
  
  
  
  1.2       +3 -3      jakarta-tomcat/src/facade23/org/apache/tomcat/facade23/RequestDispatcherImpl.java
  
  Index: RequestDispatcherImpl.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat/src/facade23/org/apache/tomcat/facade23/RequestDispatcherImpl.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- RequestDispatcherImpl.java	2000/08/23 04:06:42	1.1
  +++ RequestDispatcherImpl.java	2000/11/02 21:51:45	1.2
  @@ -166,7 +166,7 @@
   	// set the context - no need to fire context parsing again
   	realRequest.setContext( context );
   
  -	realRequest.setRequestURI( context.getPath() + path );
  +	realRequest.requestURI().setString( context.getPath() + path );
   
   	// merge query string as specified in specs - before, it may affect
   	// the way the request is handled by special interceptors
  @@ -185,7 +185,7 @@
   
   
   	// CM should have set the wrapper - call it
  -	Handler wr=realRequest.getWrapper();
  +	Handler wr=realRequest.getHandler();
   	if( wr!=null ) wr.service(realRequest, realResponse);
   
   	// close the response - output after this point will be discarded.
  @@ -302,7 +302,7 @@
    	// now it's really strange: we call the wrapper on the subrequest
   	// for the realRequest ( since the real request will still have the
   	// original handler/wrapper )
  -	Handler wr=subRequest.getWrapper();
  +	Handler wr=subRequest.getHandler();
   	if( wr!=null ) wr.service(realRequest, realResponse);
   
   	// After request, we want to restore the include attributes - for
  
  
  
  1.7       +3 -2      jakarta-tomcat/src/facade23/org/apache/tomcat/facade23/ServletWrapper.java
  
  Index: ServletWrapper.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat/src/facade23/org/apache/tomcat/facade23/ServletWrapper.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- ServletWrapper.java	2000/10/01 06:37:43	1.6
  +++ ServletWrapper.java	2000/11/02 21:51:45	1.7
  @@ -249,7 +249,8 @@
   
   	    try {
   		if( servlet!=null) {
  -		    BaseInterceptor cI[]=contextM.getInterceptors(context.getContainer());
  +		    BaseInterceptor cI[]=context.
  +			getContainer().getInterceptors();
   		    for( int i=0; i< cI.length; i++ ) {
   			try {
   			    cI[i].preServletDestroy( context, this );
  @@ -320,7 +321,7 @@
   	//}
   
   	// Call pre, doInit and post
  -	BaseInterceptor cI[]=contextM.getInterceptors(context.getContainer());
  +	BaseInterceptor cI[]=context.getContainer().getInterceptors();
   	for( int i=0; i< cI.length; i++ ) {
   	    try {
   		cI[i].preServletInit( context, this );
  
  
  

Mime
View raw message