转自:
springboot如何修改thymeleaf中默认的页面路径及默认的后缀名呢?
下文讲述springboot修改thymefleaf修改页面默认路径及后缀名的方法分享,如下所示:
实现思路:只需在配置文件中修改相应的配置即可,如:application.yaml spring:thymeleaf:prefix: classpath:/templates/ThymeLeaf/suffix: .html 指定thymeleaf模板的默认位置为: /templates/ThymeLeaf/模板的后缀名为“.html”
例:
controller中编写相关信息
@Controller public class TestController {@RequestMapping("/index")public String test(Model m){m.addAttribute("msg","adeal love java265.com");return "index";} }
上一篇:Design A Youtube
下一篇:求二进制中1的个数的三种方法