# springboot-base-four
**Repository Path**: springbook_foundation/springboot-base-four
## Basic Information
- **Project Name**: springboot-base-four
- **Description**: springboot集成thymeleaf thymeleaf语法说明
- **Primary Language**: Unknown
- **License**: Not specified
- **Default Branch**: master
- **Homepage**: None
- **GVP Project**: No
## Statistics
- **Stars**: 0
- **Forks**: 0
- **Created**: 2019-05-24
- **Last Updated**: 2020-12-19
## Categories & Tags
**Categories**: Uncategorized
**Tags**: None
## README
## [thymeleaf官网](https://www.thymeleaf.org/)
## [本项目地址](https://gitee.com/springbook_foundation/springboot-base-three)
### Thymeleaf是一个适用于Web和独立环境的现代服务器端Java模板引擎。
### Thymeleaf的主要目标是为您的开发工作流程带来优雅的自然模板 - 可以在浏览器中正确显示的HTML,也可以用作静态原型,从而在开发团队中实现更强大的协作。
### 通过Spring Framework模块,与您喜欢的工具的大量集成,以及插入您自己的功能的能力,Thymeleaf是现代HTML5 JVM Web开发的理想选择 - 尽管它可以做得更多。
### 基础maven包
1. spring-boot-starter-parent springboot 启动父包
2. spring-boot-starter-web 开启web服务
3. spring-boot-starter-test 测试类包
4. spring-boot-maven-plugin plugin插件 能够将Spring Boot应用打包为可执行的jar或war文件
5. spring-boot-starter-thymeleaf thymeleaf模板引擎开发包
### springBoot项目 目录结构
```
│ pom.xml
└─src
└─main
├─java
│ └─com
│ └─base
│ │ Application.java
│ │
│ ├─config
│ │ WebMvcConfig.java
│ │
│ └─controller
│ IndexController.java
│
└─resources
│ application.yml ## springboot配置文件
│
├─static ## 静态资源目录(js,css,image)
└─templates
index.html thymeleaf文件
```
### pom.xml 配置如下
```
* IndexController
*
* @author 刘志强
* @created Create Time: 2019/5/23
*/
@Controller
public class IndexController {
// 重定向至首页
@GetMapping("/")
public void root(HttpServletResponse httpServletResponse) throws IOException {
httpServletResponse.sendRedirect("/index");
}
@GetMapping("/index")
public ModelAndView index(ModelMap modelMap) {
modelMap.put("userName","刘志强");
modelMap.put("url","https://www.baidu.com/img/bd_logo1.png");
modelMap.put("date",new Date());
Map