1.先获取 serlvetContext对象

2.调用getResourceAsStream  在方法里 "\"表示当前web的根目录  还要拼接上具体的文件路径

ServletContext context = getServletContext();
InputStream path1 = context.getResourceAsStream("/WEB-INF/userInfo.properties");

获取web服务器路径的方法  getResourceAsStream

 


 
                    
            
                

相关文章:

  • 2022-12-23
  • 2022-02-07
  • 2021-06-29
  • 2022-12-23
  • 2021-06-26
  • 2022-02-21
  • 2021-12-19
猜你喜欢
  • 2022-12-23
  • 2021-12-09
  • 2021-11-27
  • 2021-12-09
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案