tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cos...@apache.org
Subject cvs commit: jakarta-tomcat/src/share/org/apache/tomcat/util/xml XmlMapper.java
Date Mon, 16 Jul 2001 00:20:58 GMT
costin      01/07/15 17:20:58

  Modified:    src/share/org/apache/tomcat/util/xml XmlMapper.java
  Log:
  Use the class loader set by the user when creating objects.
  
  Revision  Changes    Path
  1.34      +5 -3      jakarta-tomcat/src/share/org/apache/tomcat/util/xml/XmlMapper.java
  
  Index: XmlMapper.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/util/xml/XmlMapper.java,v
  retrieving revision 1.33
  retrieving revision 1.34
  diff -u -r1.33 -r1.34
  --- XmlMapper.java	2001/06/28 07:15:02	1.33
  +++ XmlMapper.java	2001/07/16 00:20:57	1.34
  @@ -407,7 +407,8 @@
   			     obj=attributes.getValue("action");
   			     if( obj!=null) {
   				 try {
  -				     Class c=Class.forName( obj );
  +				     ClassLoader cl=getClassLoader();
  +				     Class c=cl.loadClass( obj );
   				     Object o=c.newInstance();
   				     mapper.addRule( match, (XmlAction)o);
   				 } catch( Exception ex ) {
  @@ -675,6 +676,7 @@
       public void start( SaxContext ctx) throws Exception {
   	String tag=ctx.getCurrentElement();
   	String classN=className;
  +	ClassLoader cl=ctx.getClassLoader();
   
   	if( attrib!=null) {
   	    AttributeList attributes = ctx.getCurrentAttributes();
  @@ -685,7 +687,7 @@
   	if( pref!=null && classN.indexOf( "." ) <0 ) {
   	    for( int i=0; i<pref.length; i++ ) {
   		try {
  -		    c=Class.forName( pref[i] + classN );
  +		    c=cl.loadClass( pref[i] + classN );
   		    if( c!=null ) break;
   		} catch( Exception ex ) {
   		    if( ctx.getDebug() > 0 )
  @@ -695,7 +697,7 @@
   	    }
   	}
   	if( c==null ) {
  -	    c=Class.forName( classN );
  +	    c=cl.loadClass( classN );
   	}
   	Object o=c.newInstance();
   	ctx.pushObject(o);
  
  
  

Mime
View raw message