Berin,
This is null only in tomcat 3.2.*, to shows better results in tomcat-4.0 and
weblogic....
Thanks,
dims
--- [EMAIL PROTECTED] 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:[EMAIL PROTECTED]">Ricardo Rocha</a>
> * @author <a href="mailto:[EMAIL PROTECTED]">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: [EMAIL PROTECTED]
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
=====
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: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]