SpringBoot使用自定义的properties
来源:互联网 发布:veleq电气仿真软件 编辑:程序博客网 时间:2024/06/05 05:51
自定义的是demo.properties,其中demo.name=李四
demo.id=1demo.name=\u674E\u56DB
package com.example.demo.bean;import org.springframework.beans.factory.annotation.Value;import org.springframework.context.annotation.PropertySource;import org.springframework.stereotype.Component;@Component//加入到ioc容器@PropertySource("classpath:demo.properties")//引入自己的propertiespublic class Demo {@Value("${demo.id}")private Integer id;@Value("${demo.name}")private String name;public Integer getId() {return id;}public void setId(Integer id) {this.id = id;}public String getName() {return name;}public void setName(String name) {this.name = name;}@Overridepublic String toString() {return "Demo [id=" + id + ", name=" + name + "]";}}
阅读全文
1 0
- SpringBoot使用自定义的properties
- SpringBoot:Spring Boot使用自定义的properties
- springboot-加载自定义的properties文件
- SpringBoot 自定义properties
- SpringBoot 学习记录(八): properties 属性自定义
- Springboot的配置文件Application.properties
- springboot的application.properties配置
- Spring Boot使用自定义的properties
- Spring Boot使用自定义的properties
- Spring Boot使用自定义的properties
- Spring Boot使用自定义的properties
- Spring Boot使用自定义的properties
- Spring Boot使用自定义的properties
- Spring Boot中使用自定义的properties
- Android自定义配置文件(.properties文件)的使用
- Spring Boot使用自定义的properties
- Spring Boot使用自定义的properties属性
- springboot使用自定义配置文件
- Angular Material GridList组件
- LeetCode-98. Validate Binary Search Tree
- 以太坊核心概念开发如何用数字货币引领区块链
- opencv编译安装contrib包的注意事项和错误解决
- 数据库探索之旅——初识数据库
- SpringBoot使用自定义的properties
- 浅谈 堆
- javascript方法中new方式和字面量方式的区别
- Linux常用文本处理工具总结备忘(grep,awk,sed,cut...)
- java函数参数中:用参数值带回结果(类似传址)的方式及各种观点辨析
- CentOS网络设置 couldn't resolve host 'mirrorlist.centos.org问题解决
- C++ 变量类型
- Python第三方库安装超时timeout
- man命令的使用