起因:

搭建了springboot项目,在尝试跳转到jsp页面的时候,提示找不到相应模板

按照网上配置,资源文件:

springboot Error resolving template的问题

pom文件:

springboot Error resolving template的问题

相关依赖也都正常添加

controller:

springboot Error resolving template的问题

也是正常的mvc格式

但是一直访问页面提示:

springboot Error resolving template的问题

 

最后发现springboot 默认是使用thymeleaf的,会和jsp的配置冲突,想使用jsp的话需要禁用掉该配置,不影响html的使用

springboot Error resolving template的问题

禁用后,启动。访问页面,正常了

小插曲:springboot 新建项目默认是没有webapp等目录的,所以如果目录配置错误,会提示404找不到页面,正确的webapp目录存放地址为:

springboot Error resolving template的问题

在IDEA中配置:

springboot Error resolving template的问题

springboot Error resolving template的问题

就可以了

相关文章:

  • 2021-05-09
  • 2021-05-15
  • 2021-10-23
  • 2021-10-04
  • 2022-01-31
  • 2022-12-23
  • 2021-08-15
  • 2021-04-22
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-05-12
  • 2022-12-23
  • 2021-06-22
  • 2021-09-01
相关资源
相似解决方案