Spring Boot 使用 Groovy 模板引擎开发视图层

Spring Boot 使用 Groovy 模板引擎开发视图层

image.png

groovy模板页面扩展名是 .tpl

TplApplication.kt

package com.easy.springboot.tpl

import org.springframework.boot.autoconfigure.SpringBootApplication
import org.springframework.boot.runApplication

@SpringBootApplication
class TplApplication

fun main(args: Array<String>) {
    runApplication<TplApplication>(*args)
}

jack@jacks-MacBook-Air:~/KotlinSpringBoot/tpl$ tree
.
├── build
│   ├── kotlin
│   │   ├── compileKotlin
│   │   └── compileTestKotlin
│   └── kotlin-build
│       └── version.txt
├── build.gradle
├── gradle
│   └── wrapper
│       ├── gradle-wrapper.jar
│       └── gradle-wrapper.properties
├── gradlew
├── gradlew.bat
├── src
│   ├── main
│   │   ├── kotlin
│   │   │   └── com
│   │   │       └── easy
│   │   │           └── springboot
│   │   │               └── tpl
│   │   │                   └── TplApplication.kt
│   │   └── resources
│   │       ├── application.properties
│   │       ├── static
│   │       └── templates
│   └── test
│       └── kotlin
│           └── com
│               └── easy
│                   └── springboot
│                       └── tpl
│                           └── TplApplicationTests.kt
├── tpl.iml
├── tpl.ipr
├── tpl.iws
├── tpl_main.iml
└── tpl_test.iml

23 directories, 14 files

详细 参考资料:

https://spring.io/blog/2014/05/28/using-the-innovative-groovy-template-engine-in-spring-boot

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容