• Post Reply Bookmark Topic Watch Topic
  • New Topic

Where Do I Place The Properties File?  RSS feed

 
JiaPei Jen
Ranch Hand
Posts: 1309
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am trying to leave out the information, such as driver, url, username, password from the class that gets a connection from a connection pool. I store those information in the dbConnectionProperties.prop file.
Am I supposed to put this properties file at the application root? Is the application root the same as the root of the ServletContext? In terms of Tomcat, is the root at:
$TOMCATHOME/webapps/ROOT?


Here is the property files
 
Mike Curwen
Ranch Hand
Posts: 3695
IntelliJ IDE Java Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I would put the properties in WEB-INF/classes
and use the code found in this post: (William Brogden's post)

http://www.coderanch.com/t/348343/Servlets/java/relative-path-name-propertiesObject-load
 
Mike Curwen
Ranch Hand
Posts: 3695
IntelliJ IDE Java Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Here is another great discussion of this topic:
http://www.coderanch.com/t/354496/Servlets/java/best-place-properties-files-Web
 
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!