如何读取WEB-INF目录中的文件?

时间:2021-07-05 17:18:11

I'm running Java web application using Tomcat and I want to read a Properties file that's located in my WEB-INF directory. How can I get an InputStream to this Properties file so I can read it?

我正在使用Tomcat运行Java Web应用程序,我想读取位于WEB-INF目录中的Properties文件。如何获取此Properties文件的InputStream以便我可以读取它?

1 个解决方案

#1


ServletContext.getResource/getResourceAsStream, IIRC.

#1


ServletContext.getResource/getResourceAsStream, IIRC.