web下加载资源文件
来源:互联网 发布:protobuf java any 编辑:程序博客网 时间:2024/06/03 05:04
1、加载xml文件
import org.apache.commons.configuration.XMLConfiguration;
public void test(){
try {
XMLConfiguration configuration = new XMLConfiguration("configuration.xml");
String str=configuration.getString("java_cacerts");
System.out.println(str);
} catch (ConfigurationException e) {
e.printStackTrace();
}
}
2、加载properties的文件
import java.util.Properties;
public void test(){
// XMLConfiguration configuration = new XMLConfiguration("config.properties");
Properties prop = new Properties();
InputStream in =this.getClass().getClassLoader().getResourceAsStream("config.properties");
try {
prop.load(in);
} catch (IOException e) {
e.printStackTrace();
}
System.out.println(prop.getProperty("email"));
}
- web下加载资源文件
- 获取web应用下加载资源文件的方法
- web应用加载资源文件
- Java Web项目加载properties资源文件
- 加载web应用资源文件路径
- web--资源的加载
- SpringMVC加载web下的静态资源:css、js
- J2EE之普通类加载web资源文件的方法
- WEB工工程中加载资源文件的方法
- linux下加载文件资源好纠结呀
- java从类路径下加载资源文件
- 动态加载资源文件
- spring加载资源文件
- spring加载资源文件
- 加载属性资源文件
- 加载国际化资源文件
- java加载资源文件
- ServletContext加载资源文件
- 排错:使用IE浏览器USB企业激活BlackBerry手机
- SAP BW中的基本概念
- Ajax缓存解决办法
- IM
- 打印流PrintStream、管道流
- web下加载资源文件
- JAVA Check Memory Info
- Java -HotSpot -Client -Server 介绍 .
- iPhone-编写Apple Push Notification服务器
- 一个用于列举所有线程的JSP页面,便于调试(转载)
- 基于3G的短信开发
- 通过232串口实现远端接收启动信息和登录系统
- C#分页面向对象封装[支持多表连接查询分页]-教学示范版--分页实现
- Linux内核驱动--多点触摸