We use Springboot this framework when you must use or have seen application.properties or APPLICATION.YML, can not live by someone will ask these two documents in the end what is the case, in fact, these two are springboot left the configuration text Can be configured, let's talk about some of the differences between the two of them.
First of all, we should be the most concerned about the format of the problem, two files in the configuration when the format is the same? The properties file must be a key in the configuration---value, the explanation for this is that a complete explanation of a given electrical configuration must be at the same level, which we can see as shown:
Then let's take a look at how we should configure the same effect in the Yml file:
The format we can observe is that the Yml file is a cascade presentation, and we should pay attention to several aspects:
1> in the properties file "." The connection in the Yml file is all replaced with ":" To connect, and each level must be wrapped, at the beginning of the second level should be a TAB key indentation, of course, if the sibling does not need to indent
2> in the Yml file if you need to assign a value, you must do a space bar indent after ":".
3> in the Yml file all the configuration, the same level can only appear once, for example, we use the spring level, then we are in the back of the spring level configuration must be done in this place, cannot write a spring level
Springboot Introductory Article--some things about the properties and yml two configuration files