java类中获取WEB-INF路径
2024-10-11 15:57:09
WEB-INF路径
String path = WsTestBOImpl.class.getClass().getResource("/").getPath();
path = path.substring(1, path.indexOf("classes")); web-inf 下面的classses路径(也就是src路径)
String path = WsTestBOImpl.class.getClass().getResource("/").getPath();
path = path.substring(1, path.length()); --获取.properties配置文件的值--
Properties p = new Properties();
p.load(new FileInputStream(path + "aaa.properties"));
String s = p.getProperty("name");
最新文章
- rpc使用JUnit模块测试设计的方法及常见问题
- hdu1520 Anniversary party (树形dp)
- git 基本配置及使用
- Ibatis对日期的处理
- Spring整合Tiles
- 用imageROI来增加某范围的像素
- Implementation Documentation[转]
- poj 1986
- Netty4.x中文教程系列(四) 对象传输
- Unity3D 问题流水总结
- UVA-548Tree(二叉树的递归遍历)
- Windows文件监视器 1.0 绿色版
- mysql触发器的使用
- leetcode range sum query
- JDK10安装配置详解
- vue的基本指令
- C# float与UInt16互转
- Intellij IDEA使用Docker插件部署应用
- mysql 用户及权限
- centos7 安装、使用git