• Post Reply Bookmark Topic Watch Topic
  • New Topic

arguments to a properties file  RSS feed

 
vinitha simon
Ranch Hand
Posts: 64
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a mail.properties file, to which I should pass the name as an argument... the properties file looks similar to this

message = hi ${0} , This is a test mail.

the name is dynamic and is passed when the properties file is loaded.

I'm loading it using ResourceBundle. I'm unsure how to pass the name as the argument and how to get it to reflect in the properties file....

Any help is appreciated!

TIA,
 
Steve Luke
Bartender
Posts: 4181
22
IntelliJ IDE Java Python
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Once you read the property in from the bundle, you pass it to a MessageFormat to insert the parameters:
See: MessageFormat API
Example:
 
Ramya Chowdary
Ranch Hand
Posts: 252
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Already answered Here
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!