「 SPRINGBOOT篇 」 十月 30, 2017
SpringBoot 读取 JSON 文件并转化为 JSON 对象
文章字数 1.4k 阅读约需 1 mins.
通过注解读取文件
@Value("classpath:static/json/addTask.json")
Resource addTaskJson;
其他配置
前缀 | 例子 | 说明 |
---|---|---|
classpath: | classpath:com/myapp/config.xml | 从classpath中加载 |
file: | file:/data/config.xml | 作为 URL 从文件系统中加载 |
http: | http://myserver/logo.png | 作为 URL 加载... |