http://www.cnblogs.com/dragonfei/archive/2016/10/09/5906474.html
********************************************
1.简单示例:
SpringBoot中的的配置简单属性类支持ConfigurationProperties方式,看一个简单的示例。
1 @ConfigurationProperties(prefix = "org.dragonfei.demo")
2 public class DemoProperties {
3 private String name;
4 private String password;
5 private String test;
6
7 public String getName() {
8 return name;
9 }
10
11 public void setName(String name) {
12 this.name = name;
13 }
14
15 public String getPassword() {
16 return password;
17 }
18
19 public void setPassword(String password) {
20 this.password = password;
21 }
22
23 public String getTest() {
24 return test;
25 }
26
27 public void setTest(String test) {
28 this.test = test;
29 }
30
31 @Override
32 public String toString() {
33 return "DemoProperties{" +
34 "name='" + name + '\'' +
35 ", password='" + password + '\'' +
36 ", test='" + test + '\'' +
37 '}';
38 }
39 }
1 org.dragonfei.demo.name=dragonfei
2 org.dragonfei.demo.password=password
3 org.dragonfei.demo.test=test