Spring Boot change value properties file -


hi i'm using spring boot. dynamically replace contents of variable in properties file.

this file: message.properties

message=welcome ${bean.name}  website 

i know if there way change value of variable. thanks

if comes messages.properties file, don't have change dynamically content. instead can use message variables. take @ example:

messages.properties:

message=welcome {0} website 

if process message using messagesource bean, can message with:

messagesource.getmessage("message", new object[] { "test" }, localecontextholder.getlocale()) 

the returned string in case is:

welcome test website 

of course need inject messagesource class (controller,service) before can use exemplary code:

@autowired messagesource messagesource 

Comments

Popular posts from this blog

java - Custom OutputStreamAppender not run: LOGBACK: No context given for <MYAPPENDER> -

c++ - No viable overloaded operator for references a map -

java - UML - How would you draw a try catch in a sequence diagram? -