• Post Reply Bookmark Topic Watch Topic
  • New Topic

Properties file dynamic value  RSS feed

 
Adam Teg
Ranch Hand
Posts: 59
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a properties file. I want to add dynamic value. Example

101=Error 'DYNAMIC VALUE' stoping application.

How can I do this with in Java?

Thanks
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13078
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
A properties file is just a bunch of text lines - each containing a name and a value.

How the program interprets the value is up to the programmer. Properties files are usually read just once - when the program starts - if you want different behaviour you will have to program it.

Bill
 
Stan James
(instanceof Sidekick)
Ranch Hand
Posts: 8791
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Are you looking to replace the text DYNAMIC VALUE with a message you make up at runtime? Look at the MessageFormat doc. In recent JREs also look at PrintStream and PrintWriter printf() methods.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!