获取类是从那个jar包中加载的

http://www.ibm.com/developerworks/cn/websphere/library/techarticles/1108_jiangwk_classloader/1108_jiangwk_classloader.html


http://blog.itpub.net/145274/viewspace-591473/

http://www.ibm.com/developerworks/cn/websphere/library/techarticles/haoaili/0512/

http://3ms.huawei.com/hi/blog/41349_1800137.html

     ClassLoader classLoader = TestClassLoad.class.getClassLoader();
        URL resource = classLoader.getResource("org/apache/http/message/BasicLineFormatter.class");
        System.out.println(resource);
        
        FileUpload fu = new FileUpload(); 
        java.security.CodeSource cs = fu.getClass().getProtectionDomain().getCodeSource(); 
        System.out.println("CodeSource of FileUpload is: " + cs.toString());

猜你喜欢

转载自bbsanwei.iteye.com/blog/2323235