SpringBoot在springmvc的视图解析器方面就默认集成了ContentNegotiatingViewResolver和BeanNameViewResolver,在视图引擎上就已经集成自动配置的模版引擎,如下:
1. FreeMarker
2. Groovy
3. Thymeleaf
4. Velocity (deprecated in 1.4)
6. Mustache

JSP技术spring boot 官方是不推荐的,原因有三:
1. 在tomcat上,jsp不能在嵌套的tomcat容器解析即不能在打包成可执行的jar的情况下解析
2. Jetty 嵌套的容器不支持jsp
3. Undertow

而其他的模版引擎spring boot 都支持,并默认会到classpath的templates里面查找模版引擎。

一、集成freemarker模版引擎视图

1.现在pom.xml启动freemarker模版引擎视图

1 <dependency>
2     <groupId>org.springframework.boot</groupId>
3     <artifactId>spring-boot-starter-freemarker</artifactId>
4 </dependency>
pom freemarker

相关文章:

  • 2021-07-06
  • 2021-06-23
  • 2021-10-07
  • 2022-12-23
  • 2022-12-23
  • 2021-07-06
  • 2021-07-26
  • 2021-06-10
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-11-17
  • 2021-12-28
  • 2021-08-05
  • 2021-04-17
  • 2021-06-08
相关资源
相似解决方案