ITeye博客

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

bbsanwei · 2016-09-08 00:05 · JAVA · 编程语言 · Markdown

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());


评论(0)

暂无评论。

评论功能维护中,当前仅展示历史评论。