67,513
社区成员
发帖
与我相关
我的任务
分享
//根据key读取value
public static String readValue(String key) {
Properties props = new Properties();
try {
InputStream in = new BufferedInputStream(new FileInputStream("/uas-operation.properties"));
props.load(in);
String value = props.getProperty(key);
System.out.println(key + value);
return value;
} catch (Exception e) {
e.printStackTrace();
return "";
}
public static String readValue(String key) {
Properties props = new Properties();
FileInputStream fis=null
try {
fis=new FileInputStream(new File(UasTagFunction.class.getResource("/").getPath()+"config\uas-system.properties"));
props.load(fis);
String value = props.getProperty(key);
return value;
} catch (Exception e) {
e.printStackTrace();
return "";
}
}
public static String readValue(String key) {
Properties props = new Properties();
try {
InputStream in=UasTagFunction.class.getResourceAsStream("/uas-operation.properties");
props.load(in);
String value = props.getProperty(key);
return value;
} catch (Exception e) {
e.printStackTrace();
return "";
}
}
request.getSession().getServletContext().getRealPath("/WEB-INF/config/uas-system.properties");