using properties file in spring java mvc along with xml files
HI,
I have a spring java project i found that its using two files :
1) database.xml
2) database.properties
The database.properties file specify the jdbc url and username and password
These properties are then used in database.xml file with the notation "${}" to access the jdbc url and username and password
My question is why create the database.properties file in the first place ? arent xml files also non compiled and so one can directly edit them without restarting the server ?
Is it just for a readability purpose or there are some other significance of using this pattern ?
what is the exact reason.
1) why server restart is not required when changing properties file?
2) why it is required when xml is changed ?
i have read somewhere that there are hot deployment ways. like using jrebel etc which automatically handles any change....i think using that does not require server restart
srikotesh
properties file no need to compile
where as xml we need to recompile and restart the server.
As to what support the application has for HOT changes to those setting, it is still a case-by-case basis. As you have it now, where those properties are used by the XML with ${} placeholders, without further external support you STILL need to restart the server for any changes to those DB parameters.
However, there are other cases where you CAN easily support HOT changes to .properties file without needing server restarts, and you could do this easier than having the changes applied to the .xml file.
1) why server restart is not required when changing properties file?
2) why it is required when xml is changed ?
i have read somewhere that there are hot deployment ways. like using jrebel etc which automatically handles any change....i think using that does not require server restart