• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Properties File

 
Danish Shaukat
Ranch Hand
Posts: 341
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all!
I've got some hard coded urls in a servlet. I want to move them in a properties file so thatif i change them i need not recompile my servlet.
Anyone knows how to make this properties file??
Regards
Danish Shaukat
 
Geoff Tate
Ranch Hand
Posts: 55
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
the easiest way is to put the properties file in a directory on the classpath of your servlet. Check the docs on how to load properties from a file. The convention is to the name the file something like yourapp.properties.
 
maha anna
Ranch Hand
Posts: 1467
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
A sample properties file format is here http://www.javaranch.com/ubb/Forum7/HTML/002702.html
regds
maha anna
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic