cvs commit: jakarta-tomcat/src/share/org/apache/tomcat/modules/generators Jdk12Interceptor.java

2004-04-26 Thread billbarker
billbarker2004/04/26 19:45:13

  Modified:src/share/org/apache/tomcat/modules/generators
Jdk12Interceptor.java
  Log:
  Reset the Context CL correctly after an include.  Also, adding a PostRequest so the 
the Context CL is in a defined state after the request finishes.
  
  The rule is that if the Child has a Parent, then the Parent is the request that 
included.  Otherwise, the including request is the top-level one.
  
  There are still CL issues with cross-context RD reqests, but this at least fixes the 
bug that was there with same-context RD requests.
  
  Fix for Bug #28590
  Reported By: Hugh J. Lee [EMAIL PROTECTED]
  
  Revision  ChangesPath
  1.11  +9 -4  
jakarta-tomcat/src/share/org/apache/tomcat/modules/generators/Jdk12Interceptor.java
  
  Index: Jdk12Interceptor.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/modules/generators/Jdk12Interceptor.java,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- Jdk12Interceptor.java 25 Feb 2004 06:52:40 -  1.10
  +++ Jdk12Interceptor.java 27 Apr 2004 02:45:12 -  1.11
  @@ -93,11 +93,16 @@
   
// after include, reset the class loader
// fix for 1112
  - request=child.getParent();
  - if( request != null )
  - fixJDKContextClassLoader(request.getContext());
  + Request chParent=child.getParent();
  + if( chParent != null )
  + fixJDKContextClassLoader(chParent.getContext());
else
  - jdk11Compat.setContextClassLoader(this.getClass().getClassLoader());
  + fixJDKContextClassLoader(request.getContext());
  + return 0;
  +}
  +
  +public int postRequest(Request request, Response response) {
  + jdk11Compat.setContextClassLoader(this.getClass().getClassLoader());
return 0;
   }
   
  
  
  

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



cvs commit: jakarta-tomcat/src/share/org/apache/tomcat/modules/generators Jdk12Interceptor.java

2002-06-26 Thread billbarker

billbarker2002/06/26 21:20:52

  Modified:src/share/org/apache/tomcat/modules/generators
Jdk12Interceptor.java
  Log:
  Make certain the the Context Classloader is set when a servlet is loaded.
  
  With this, you can load classes that depend of the Context Classloader in the 
constructor or static class initializer.
  
  Fix for bug #7654
  Reported By: Maxim Golubitsky [EMAIL PROTECTED]
  
  Revision  ChangesPath
  1.7   +13 -0 
jakarta-tomcat/src/share/org/apache/tomcat/modules/generators/Jdk12Interceptor.java
  
  Index: Jdk12Interceptor.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/modules/generators/Jdk12Interceptor.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- Jdk12Interceptor.java 19 Jul 2001 21:45:52 -  1.6
  +++ Jdk12Interceptor.java 27 Jun 2002 04:20:52 -  1.7
  @@ -82,6 +82,13 @@
fixJDKContextClassLoader(ctx);
   }
   
  +public int preInitCheck( Request req, Handler sw )
  + throws TomcatException
  +{
  + fixJDKContextClassLoader(ctx);
  + return 0;
  +}
  +
   /** Servlet Destroy  notification
*/
   public void preServletDestroy( Context ctx, Handler sw )
  @@ -102,6 +109,12 @@
jdk11Compat.setContextClassLoader(this.getClass().getClassLoader());
   }
   
  +public int postInitCheck( Request req, Handler sw )
  + throws TomcatException
  +{
  + jdk11Compat.setContextClassLoader(this.getClass().getClassLoader());
  + return 0;
  +}
   /** Called before service method is invoked. 
*/
   public int preService(Request request, Response response) {
  
  
  

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




cvs commit: jakarta-tomcat/src/share/org/apache/tomcat/modules/generators Jdk12Interceptor.java

2001-07-19 Thread costin

costin  01/07/19 14:45:52

  Modified:src/share/org/apache/tomcat/modules/generators
Jdk12Interceptor.java
  Log:
  Another try.
  
  Revision  ChangesPath
  1.6   +3 -3  
jakarta-tomcat/src/share/org/apache/tomcat/modules/generators/Jdk12Interceptor.java
  
  Index: Jdk12Interceptor.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/modules/generators/Jdk12Interceptor.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- Jdk12Interceptor.java 2001/07/19 21:44:24 1.5
  +++ Jdk12Interceptor.java 2001/07/19 21:45:52 1.6
  @@ -93,13 +93,13 @@
   public void postServletDestroy( Context ctx, Handler sw )
throws TomcatException
   {
  - jdk11Compat.setContextClassLoader(this.getClass().getLoader());
  + jdk11Compat.setContextClassLoader(this.getClass().getClassLoader());
   }
   
   public void postServletInit( Context ctx, Handler sw )
throws TomcatException
   {
  - jdk11Compat.setContextClassLoader(this.getClass().getLoader());
  + jdk11Compat.setContextClassLoader(this.getClass().getClassLoader());
   }
   
   /** Called before service method is invoked. 
  @@ -125,7 +125,7 @@
if( request != null )
fixJDKContextClassLoader(request.getContext());
else
  - jdk11Compat.setContextClassLoader(this.getClass().getLoader());
  + jdk11Compat.setContextClassLoader(this.getClass().getClassLoader());
return 0;
   }
   
  
  
  



cvs commit: jakarta-tomcat/src/share/org/apache/tomcat/modules/generators Jdk12Interceptor.java

2001-03-31 Thread costin

costin  01/03/31 13:51:49

  Modified:src/share/org/apache/tomcat/modules/generators
Jdk12Interceptor.java
  Log:
  Fix for #1112. Thanks Adnan Music for the report.
  
  Revision  ChangesPath
  1.3   +17 -17
jakarta-tomcat/src/share/org/apache/tomcat/modules/generators/Jdk12Interceptor.java
  
  Index: Jdk12Interceptor.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/modules/generators/Jdk12Interceptor.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- Jdk12Interceptor.java 2001/01/25 05:07:38 1.2
  +++ Jdk12Interceptor.java 2001/03/31 21:51:48 1.3
  @@ -101,10 +101,27 @@
*/
   public int preService(Request request, Response response) {
if( request.getContext() == null ) return 0;
  + // fix for 1112
  + Request child=request.getChild();
  + if( child!=null ) {
  + request=child;
  + }
fixJDKContextClassLoader(request.getContext());
return 0;
   }
   
  +public int postService(Request request, Response response) {
  + Request child=request.getChild();
  + if( child==null ) return;
  +
  + // after include, reset the class loader
  + // fix for 1112
  + Request child=request.getChild();
  + request=child.getParent();
  + if( request != null )
  + fixJDKContextClassLoader(request.getContext());
  +}
  +
   static Jdk11Compat jdk11Compat=Jdk11Compat.getJdkCompat();
   
   
  @@ -126,23 +143,6 @@
return; // nothing to do - or in include if same context

jdk11Compat.setContextClassLoader(cl);
  - // XXX if sandboxing is enabled and include() is not doing
  - // doPriviledged, then the code that checks for cross-context
  - // calls must also set the class loader or doPriviledged.
  - 
  - // include() has it's own doPrivileged, no need for a second.
  - 
  -//   // this may be called from include(), in which case we
  -//   // have the codebase==jsp or servlet
  -//   java.security.AccessController.doPrivileged(new
  -//   java.security.PrivilegedAction()
  -//   {
  -//   public Object run()  {
  -//   Thread.currentThread().setContextClassLoader(cl);
  -//   return null;
  -//   }
  -//   });
  - 
   }
   
   }
  
  
  



cvs commit: jakarta-tomcat/src/share/org/apache/tomcat/modules/generators Jdk12Interceptor.java

2001-03-31 Thread costin

costin  01/03/31 14:32:06

  Modified:src/share/org/apache/tomcat/modules/generators
Jdk12Interceptor.java
  Log:
  Syntax errors...
  
  Revision  ChangesPath
  1.4   +2 -2  
jakarta-tomcat/src/share/org/apache/tomcat/modules/generators/Jdk12Interceptor.java
  
  Index: Jdk12Interceptor.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/modules/generators/Jdk12Interceptor.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- Jdk12Interceptor.java 2001/03/31 21:51:48 1.3
  +++ Jdk12Interceptor.java 2001/03/31 22:32:05 1.4
  @@ -112,14 +112,14 @@
   
   public int postService(Request request, Response response) {
Request child=request.getChild();
  - if( child==null ) return;
  + if( child==null ) return 0;
   
// after include, reset the class loader
// fix for 1112
  - Request child=request.getChild();
request=child.getParent();
if( request != null )
fixJDKContextClassLoader(request.getContext());
  + return 0;
   }
   
   static Jdk11Compat jdk11Compat=Jdk11Compat.getJdkCompat();