Properties properties = new Properties();
File file = new File(request.getRealPath("/") +"//WEB-INF//classes//configs.properties");
FileInputStream fiStream = new FileInputStream(file);
InputStreamReader isReader = new InputStreamReader(fiStream,"utf-8");
properties.load(isReader);
String path = properties.getProperty("docpath");
jsp读取配置文件乱码解决
最新推荐文章于 2020-04-27 19:03:06 发布
本文介绍了一种使用Java从Web应用程序的配置文件中加载属性的方法。通过实例展示了如何利用FileInputStream与InputStreamReader来读取UTF-8编码的properties文件,并获取特定属性值。

456

被折叠的 条评论
为什么被折叠?



