//**读取properties配置文件的类
import java.util.*;
import java.io.*;
public final class ParseProperties {
private static Properties properties = null;
private ParseProperties() {
}
public static String getProperties(String propStr){
if(properties==null){
try{
InputStream is=ParseProperties.class.getClassLoader().getResourceAsStream("runqianServ.properties");
properties = new Properties();
properties.load(is);
is.close();
}catch(Exception e){
e.printStackTrace();
}
}
return properties.getProperty(propStr);
}
public static void main(String[] args) {
String driver=ParseProperties.getProperties("runqianServ");
System.out.println(driver);
}
}
在apache-tomcat-5.5.17使用Struts Tag会抛出Failer to load or instantiate TagExtraInfo class:org.apache.struts.taglib.bean.CookieTei的异常。(这只是bean标签,其它标签异常略)
解决方法:删除WEB_INF/lib/javax.servlet.jsp.jar。(jsp jar包会引起冲突)