• Post Reply Bookmark Topic Watch Topic
  • New Topic

Web App Properties File Read - File Not Found

 
Deena Jeyachandran
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I am trying to read a properties file in Struts Action class.
The location of the properties file is
WEB-INF/classes/function.properties.

When I use
new FileInputStream("function.properties")
I get File Not found Exception.

Please help.

Thanks,
Deena
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65516
105
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That's because you are assuming that there is a "current directory". There is not.

Investigate use of getResourceAsStream().
[ June 01, 2008: Message edited by: Bear Bibeault ]
 
Deena Jeyachandran
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Your suggestion worked. Thanks.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!