1、添加依赖<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<!– https://mvnrepository.com/artifact/com.ibeetl/beetl-framework-starter –>
<dependency>
<groupId>com.ibeetl</groupId>
<artifactId>beetl-framework-starter</artifactId>
<version>1.1.62.RELEASE</version>
</dependency>
</dependencies>
2、添加控制器import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
@Controller
@SpringBootApplication
public class Application {
@RequestMapping("/")
public String index(){
return "/index.btl";
}
public static void main(String[] args) {
SpringApplication.run(Application.class, args);
}
}
3、添加模板在 resources/templates 目录下添加 index.btl 文件: