如何讀取WEB-INF目錄中的文件?

[英]How can I read files in my WEB-INF directory?


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.


注意!

本站翻译的文章,版权归属于本站,未经许可禁止转摘,转摘请注明本文地址:https://www.itdaan.com/blog/2009/04/08/4b5b1b1a2280bf6235719c55d7ef3165.html



 
  © 2014-2022 ITdaan.com 联系我们: