
SpringBoot
文章平均质量分 62
u013184884
这个作者很懒,什么都没留下…
展开
-
Spring Boot通过文本模式集成Thymeleaf模版引擎
Spring Boot中集成了Thymeleaf模版引擎。在网上常见的例子中,主要引用的是Spring Boot通过网页形式与Thymeleaf模版进行互动的例子。本文针对非网页程序形式的Thymeleaf集成,适用于命令行脚本生成、电子邮件根据模版生成的场景。1. 创建Spring Boot应用程序在Spring Starter创建项目时,选择spring-boot-starter-thym...原创 2018-09-21 15:08:01 · 780 阅读 · 1 评论 -
Spring Boot程序接收命令行参数
Spring Boot程序可以通过实现CommandLineRunner接口,接收来自命令行的参数。1. 创建Spring Boot应用程序通过Spring Boot提供的工具,生成样例框架程序,不用勾选任何其它额外依赖功能。2. 修改Application类修改Application类,继承CommandLineRunner接口,并实现run()方法。参考以下样例代码。package...原创 2018-09-21 17:05:13 · 5255 阅读 · 0 评论