spring boot thymeleaf

thymeleaf模板引擎

@RequestMapping修饰得方法会在底层形成映射关系写入map
前端发起请求时会到map找对应的映射
来找到对应的处理方法

默认的配置

spring.thymeleaf.prefix=/templates/
spring.thymeleaf.suffix=.html

由前端控制器DispatcherServlet调用@RequestMapping修饰的方法
由ThymeleafViewRolesver解析返回的模板
将controller处理器返回的字符串加上前缀/templates/和后缀.html
然后返回给前端控制器DispatcherServlet

错误解决:

posted @ 2020-08-15 09:37  岁月染过的梦  阅读(163)  评论(0)    收藏  举报