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?
Asked
Active
Viewed 2,048 times
3

Christian Conti-Vock
- 252
- 1
- 3
- 15

DyreSchlock
- 867
- 3
- 13
- 24
1 Answers
3
ServletContext.getResource
/getResourceAsStream
, IIRC.

Tom Hawtin - tackline
- 145,806
- 30
- 211
- 305
-
I want to know the path on the server's file-system to the resource - can you tell me how to find this out? – Tim Cooper Jul 06 '10 at 02:45
-
@TimCooper The servlet spec doesn't support this. This is because the file might not directly exist on the filesystem — it might be served directly from a .war file. What are you trying to do? – Sean Reilly Apr 27 '12 at 19:34