在pom文件引入maven依赖
<dependency><groupId>com.ibeetl</groupId><artifactId>beetl-framework-starter</artifactId><version>1.1.81.RELEASE</version></dependency>
写一个controller
/*** @author * @create * @description*/@Controllerpublic class Index {@RequestMapping("/")public String index(HttpServletRequest request){request.setAttribute("test"," Spring Boot集成Beetl成功");return "index.btl";}}
在resources目录建立一个index.btl
文件
<!DOCTYPE html>
<html lang="en">
<head><meta charset="UTF-8"><title>demo</title>
</head>
<body>${test}</body>
</html>
启动项目,测试