themeleaf是springboot推荐的页面渲染方式
用法总结暂时参见此博客
问题:1配置好之后访问测试接口报错:
1 controller:
@Controller
@RequestMapping("/demo")
public class SampleController {
@RequestMapping("/thymeleaf")
public String thymeleaf(Model model){
System.out.println("hello");
model.addAttribute("name","yuanfei");
return "hello";
}
}
2 application.properties
spring.thymeleaf.prefix=classpath:/templates/
spring.thymeleaf.suffix=.html
3 目录截图:
4 启动MainApplication
访