首页>代码>spring boot通过@ConfigurationProperties注解实现加载application.properties配置,支持多层嵌套语法>/springboot-nested-properties-file/src/main/java/com/hellokoding/util/SimpleProperties.java
package com.hellokoding.util; import org.springframework.boot.context.properties.ConfigurationProperties; import org.springframework.stereotype.Component; @Component @ConfigurationProperties(prefix = "simple") public class SimpleProperties { private String a; public String getA() { return a; } public void setA(String a) { this.a = a; } }