java


Spring Boot 1.3.5: expanding variables within application.properties file


We are using Spring Boot 1.3.5, which loads external application.properties using #PropertySource("file:C:/tmp/application.properties"). Here is how application.properties looks like:
env=prod
instance=EAST
emailSubject=${env}-${instance}: An error occurred
The code is able to see/get the correct values for env and instance variables, but the emailSubject variable is not getting substituted. And when we print it in the code, it shows
"${env}-${instance}: An error occurred"
How to make emailSubject be correctly substituted to show
"prod-EAST: An error occurred"
Without knowing much more about how it's set up, and seeing as the contents of the properties-file you posted is valid, I'll have to assume there's something wrong with how the contents is being read or used.

Related Links

Blob Store responds with 415 Unsupported Media Type
Can't select (by key of type map<text,text>) a record which has been inserted to Cassandra with Datastax Java driver
Eclipse shows same source folder as multiple source folders while creating project using existing source code
How to sum a column value in a list of hashmaps against different Keys in java
POST jersey with HeaderParam annotation
Layout displaying ImageView at the bottom of the page
Extract timestamp from row of data
Track Method Dependencies Via ASM
How to add MessageConverter on Spring boot Messaging
Collision Detection in java [closed]
How to call method of a unknown object
How can I test on other images in this supervised image processing method?
double to BigDecimal results in a 4 instead of 5 in the last place
Eclipse CDT ASTRewrite not working
creating a spring mvc porject using maven in eclipse
How can I read from two different files and put 10 random names from each for a total of 20 into the same output file

Categories

HOME
pandas
twitter
vim
asp.net-core
lodash
mean-stack
google-docs
adb
getelementsbytagname
infragistics
microservices
cross-browser
contact
user-input
quickbooks
moonmail
remote-access
flux
textfield
paging
jasonette
google-search-api
php-openssl
underflow
traffic
filezilla
fluentvalidation
atlassian-crucible
file-rename
skia
sql-server-2012-express
socialengine
media-queries
xquery-3.0
data-manipulation
framemaker
catalog
overlap
android-browser
ssjs
sqlite2
jna
mesos-chronos
galen
nand2tetris
total-commander
modelmapper
revapi
statsd
feeds
crypt
libusb-win32
spring-mongodb
spring-cache
account-kit
crosswalk-runtime
google-cdn
django-debug-toolbar
moveit
prettytensor
hill-climbing
ready-api
pyke
ios8-today-widget
jmeter-maven-plugin
kcachegrind
method-parameters
sorl-thumbnail
modalpopup
camanjs
phalanger
rdtsc
terminfo
undefined-reference
mbr
openlaszlo
mcts
cdc
plasma
html-editor
enterprisedb
wsdl-2.0
path-separator
trusted
venn-diagram
dsn
routedevent
libs
mdac
geneva-server

Resources

Encrypt Message



code
soft
python
ios
c
html
jquery
cloud
mobile