不是 springboot 项目哈。 有个老项目,ssm 框架,想用 yml
不是 springboot 项目哈。 有个老项目,ssm 框架,想用 yml
|
hantsyMay 31, 2020
1
记得可以自己实现一个 AbstractGenericContextLoader,设置定义文件后缀和相应的 BeanDefinitionReader 。
|
|
chendyMay 31, 2020
2
把 spring-boot 里读 yml 文件的部分抄进来就行了…
|
|
shylockhgMay 31, 2020
3
额非 java 程序员,不是读一下 yaml 就可以么
|
|
aitaiiMay 31, 2020 via Android
5
snakeyaml
|
|
DsuineGPJun 1, 2020
6
```xml
<context:annotation-config/> <bean id="yamlProperties" class="org.springframework.beans.factory.config.YamlPropertiesFactoryBean"> <property name="resources" value="classpath:test.yml"/> </bean> <context:property-placeholder properties-ref="yamlProperties"/> ``` |
|
qW7bo2FbzbC0Jun 1, 2020
7
用来用去,还是 toml 舒服点,yaml 的锁紧和列表语法太头疼
|