[prev in list] [next in list] [prev in thread] [next in thread] 

List:       xml-cocoon-dev
Subject:    Re: cvs commit: xml-cocoon2/src/org/apache/cocoon/util ClassUtils.java
From:       Davanum Srinivas <dims () yahoo ! com>
Date:       2001-05-31 21:24:08
[Download RAW message or body]

Berin,

This is null only in tomcat 3.2.*, to shows better results in tomcat-4.0 and weblogic....

Thanks,
dims

--- bloritsch@apache.org wrote:
> bloritsch    01/05/31 13:52:06
> 
>   Modified:    src/org/apache/cocoon/util ClassUtils.java
>   Log:
>   Still always says null, but a little better readability and correctness
>   
>   Revision  Changes    Path
>   1.7       +13 -9     xml-cocoon2/src/org/apache/cocoon/util/ClassUtils.java
>   
>   Index: ClassUtils.java
>   ===================================================================
>   RCS file: /home/cvs/xml-cocoon2/src/org/apache/cocoon/util/ClassUtils.java,v
>   retrieving revision 1.6
>   retrieving revision 1.7
>   diff -u -r1.6 -r1.7
>   --- ClassUtils.java	2001/05/31 17:39:07	1.6
>   +++ ClassUtils.java	2001/05/31 20:52:05	1.7
>   @@ -18,7 +18,7 @@
>     *
>     * @author <a href="mailto:ricardo@apache.org">Ricardo Rocha</a>
>     * @author <a href="mailto:stefano@apache.org">Stefano Mazzocchi</a>
>   - * @version CVS $Revision: 1.6 $ $Date: 2001/05/31 17:39:07 $
>   + * @version CVS $Revision: 1.7 $ $Date: 2001/05/31 20:52:05 $
>     */
>    public class ClassUtils {
>    
>   @@ -131,19 +131,23 @@
>         */
>         public static String which(String className) {
>            String path = null;
>   -        String classPath = className;
>   -        if (!classPath.startsWith("/")) {
>   -          classPath = "/" + classPath;
>   +        String classPath = "/" + className;
>   +
>   +        if (classPath.startsWith("//")) {
>   +            classPath = className.substring(1);
>            }
>   +
>            classPath = classPath.replace('.', '/');
>            classPath += ".class";
>    
>            try {
>   -            loadClass(className);
>   -            java.net.URL classUrl = getResource(classPath);
>   -            if(classUrl != null)
>   -                path = classUrl.toString();
>   -        } catch (Exception e){
>   +            ClassUtils.loadClass(className);
>   +            java.net.URL classUrl = ClassUtils.getResource(classPath);
>   +
>   +            if(classUrl != null) {
>   +                path = classUrl.toExternalForm();
>   +            }
>   +        } catch (Exception e) {
>            }
>    
>            return path;
>   
>   
>   
> 
> ----------------------------------------------------------------------
> In case of troubles, e-mail:     webmaster@xml.apache.org
> To unsubscribe, e-mail:          cocoon-cvs-unsubscribe@xml.apache.org
> For additional commands, e-mail: cocoon-cvs-help@xml.apache.org
> 


=====
Davanum Srinivas, JNI-FAQ Manager
http://www.jGuru.com/faq/JNI

__________________________________________________
Do You Yahoo!?
Get personalized email addresses from Yahoo! Mail - only $35 
a year!  http://personal.mail.yahoo.com/

---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic