jsp读取配置文件乱码解决

来源:互联网 发布:人工智能的技术原理 编辑:程序博客网 时间:2024/06/06 12:41

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");

原创粉丝点击