• Post Reply Bookmark Topic Watch Topic
  • New Topic

reading a properties file from the war file  RSS feed

 
mat buckland
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a properties file located in the root of the war file.

How do I read in that properties file when the servet is deployed?

thanks
 
Ulf Dittmer
Rancher
Posts: 42972
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That's what ServletContext.getResourceAsStream is for.

You may want to move the file from the web app root into the WEB-INF directory, though, lest it becomes publicly accessible.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!