// 我的com.aaa.bbb.XXXAction类中有一个函数。 // 使用这个函数的时候,传入的参数"/resources/cardName.properties" private Properties readPropertiesValue(String filePath) {
Properties props = new Properties();
try {
Class<? extends CouponJKBAction> clazz = this.getClass(); // 从这里跳入函数内部,参数却变成了"com.aaa.bbb.XXXAction",这是怎么回事????
InputStream in = clazz.getResourceAsStream(filePath);
props.load(in);
} catch (Exception e) {
logger.error(e.getMessage());
}
return props;
}
Properties props = new Properties();
try {
Class<? extends CouponJKBAction> clazz = this.getClass(); // 从这里跳入函数内部,参数却变成了"com.aaa.bbb.XXXAction",这是怎么回事????
InputStream in = clazz.getResourceAsStream(filePath);
props.load(in);
} catch (Exception e) {
logger.error(e.getMessage());
}
return props;
}
InputStream in = clazz.getResourceAsStream(filePath)改成:
InputStream in = clazz.getResourceAsStream("/resources/cardName.properties");然后F5进入getResourceAsStream()函数,参数的值还是"com.aaa.bbb.XXXAction",实在头疼,到底哪里写错了?