Spring boot 十二 CommandLineRuner
来源:互联网 发布:cf画面优化是什么意思 编辑:程序博客网 时间:2024/05/17 13:14
第一步:
com.zll.demo.command.CommandRun
@Component@Order(1)//如果有多个 值小的有限执行(非必要)public class CommandRun implements CommandLineRunner { @Override public void run(String... agrs) throws Exception { for (String aa: agrs){ System.out.println(aa); } }}
第二步:测试
在application.properties run方法中直接 传入 String[]{}
@SpringBootApplicationpublic class DemoApplication{ //这里只做测试,时间是 命令号args 中传进来的参数。 public static void main(String[] args) { SpringApplication.run(DemoApplication.class, new String[]{"aaaa","bbbb"}); }}
阅读全文
0 0
- Spring boot 十二 CommandLineRuner
- Spring Boot系列教程十二:Spring boot集成Redis
- Spring Boot (教程十二: AOP拦截器)
- spring boot整合hessian(十二)
- Spring Boot集成mongoDB(十二)
- spring boot 学习(十二)拦截器实现IP黑名单
- 二十二、Spring Boot中使用Redis缓存
- (十二)Spring Boot+Druid+Mybatis实现JTA分布式事务
- Spring Boot学习之旅:(十二)模版引擎-Thymeleaf
- 转载:Spring Boot (十二):springboot如何测试打包部署
- Spring Boot(十二)集成spring-boot-starter-mail发送邮件
- Spring Boot系列(十二)Spring Boot整合ActiveQ实现消息收发和订阅
- 【Spring Boot】Spring Boot
- spring boot
- spring boot
- spring-boot
- spring boot
- Spring Boot
- 解决Spring的java.lang.IllegalArgumentException异常
- 要么听我的,要么走开(摘自《代码之道》第8章)
- 使用Filter解决获取到jsp输入值为乱码的问题
- Linux ActiveMQ开源消息总线安装
- Java 阿里云短信服务的集成
- Spring boot 十二 CommandLineRuner
- Python List转str
- Django admin 学习笔记
- HDU 3449:Consumer
- 使用SolrJ管理索引库,并添加文档
- spice-client 源码解析之event_sources_p.cpp
- 终于!谷歌移动端深度学习框架TensorFlow Lite正式发布
- 从今天开始刷题,每天有一点点的小提高
- 使用solrj添加文档,导入包,之后的代码实现,接上一篇文章