zoukankan      html  css  js  c++  java
  • 从类里获取tomcat classes绝对路径

    从类里获取tomcat classes绝对路径

    从类里获取tomcat classes绝对路径

    1 从类里获取tomcat classes绝对路径

    有两种方法得到:

    1:  class.getResource("/").getPath(); 需要jaxen-*.jar
    2:  class.getClassLoader().getResource("").getPath();
    

    注意:

    1:  ClassLoader.getSystemResource("").getPath();
    

    好像是可以得到classes的绝对路径,但是得不到tomcat classes绝对路径, 这是由于jvm问题(等待再分析)。 普通工程可以使用,但web工程不能使用。

    Date: 2012-11-21 21:09:27 CST

    Author: machine of awareness

    Org version 7.8.06 with Emacs version 23

    Validate XHTML 1.0
  • 相关阅读:
    mysql常用命令
    mysql设置外网访问权限
    免费云服务部署项目
    使用虚拟主机部署Php项目总结
    github基本使用命令笔记
    git push -u origin master报错,error: failed to push some refs to 'https://github.com/Youlandawq/Qt.git' hint: Updates were rejected because the tip of your current branch is behind hint: its remote c
    centos7安装docker
    java设计模式之单例模式
    java se高级之多线程(一)
    jdbc编程
  • 原文地址:https://www.cnblogs.com/machine/p/2781501.html
Copyright © 2011-2022 走看看