情况是这样的:
struts2最新版使用了apache lang组件包,commons-lang3x.jar
我需要使用commons-configura来读取properites文件。但commons-configura依赖的却是:
commons-lang2x.jar两个版本的commons-lang.jar放入classpath 出错。
使用commons-lang2x.jar struts2会出错
使用commons-lang3x.jar commons-congigure就会出错。该怎么弄啊,我不是第一次遇到这个问题了,json-lib与最新版本的struts2也存在同样的问题。当时我直接放弃了json-lib。
有没有办法在一个project中做多个classpath,指定某一个类或几个类使用 特定的classpath?
或是其他的解决办法啊?commons-lang3json-libstruts2
struts2最新版使用了apache lang组件包,commons-lang3x.jar
我需要使用commons-configura来读取properites文件。但commons-configura依赖的却是:
commons-lang2x.jar两个版本的commons-lang.jar放入classpath 出错。
使用commons-lang2x.jar struts2会出错
使用commons-lang3x.jar commons-congigure就会出错。该怎么弄啊,我不是第一次遇到这个问题了,json-lib与最新版本的struts2也存在同样的问题。当时我直接放弃了json-lib。
有没有办法在一个project中做多个classpath,指定某一个类或几个类使用 特定的classpath?
或是其他的解决办法啊?commons-lang3json-libstruts2
解决方案 »
- 请教一个java socket的问题,为何server端读不到client端发送过来的消息,有什么办法可以解决
- 控制div不可被点击问题
- 权限用户问题
- 请问如何用JAVA代码清除SSL状态?
- java 中说的消息队列和窗口到底是什么意思??特别是窗口的概念
- 学好J2EE所需要掌握的一系列知识
- 兄弟们 struts到底有无必要学啊?疑惑中 求教了
- 要在JSP中使用刷卡机,能做到吗?
- 我用Class.forName()为什么不行???
- 在WINDWOS 2000中怎么配置JDK,使得能在WINDOWS 2000 的 DOS下用.
- java项目部署后报异常,Cause: java.sql.SQLException: 关闭的连接
- 在线录音
读取properites的方式应该很多。
ava读取Properties文件的六种方法
Java读取properties文件 【转】使用J2SE API读取Properties文件的六种方法1。使用java.util.Properties类的load()方法
示例: InputStream in = lnew BufferedInputStream(new FileInputStream(name));
Properties p = new Properties();
p.load(in);2。使用java.util.ResourceBundle类的getBundle()方法
示例: ResourceBundle rb = ResourceBundle.getBundle(name, Locale.getDefault());3。使用java.util.PropertyResourceBundle类的构造函数
示例: InputStream in = new BufferedInputStream(new FileInputStream(name));
ResourceBundle rb = new PropertyResourceBundle(in);4。使用class变量的getResourceAsStream()方法
示例: InputStream in = JProperties.class.getResourceAsStream(name);
Properties p = new Properties();
p.load(in);5。使用class.getClassLoader()所得到的java.lang.ClassLoader的getResourceAsStream()方法
示例: InputStream in = JProperties.class.getClassLoader().getResourceAsStream(name);
Properties p = new Properties();
p.load(in);6。使用java.lang.ClassLoader类的getSystemResourceAsStream()静态方法
示例: InputStream in = ClassLoader.getSystemResourceAsStream(name);
Properties p = new Properties();
p.load(in);