您现在的位置是:网站首页 > 学无止境
springboot获取配置文件值
简介springboot获取配置文件值,yml配置文件属性值java获取
port: 8989
Person:
name: zs123
age: 100
boss: true
brith: 2023/11/12
mps: {k1: v1,k2: 12}
lis:
- lisi
- zhaoliu
dg:
d_name: xiaogou
d_age: 2
import com.example.demo.Bean.Person;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
@SpringBootTest
class DemoApplicationTests {
@Autowired
Person person;
@Test
void contextLoads() {
System.out.println(person);
}
}
上一篇:暂无上篇