无法解析MVC视图的解决方案
更新时间:2026年01月23日 09:08:19 作者:追梦梓辰
文章介绍了当idea无法解析MVC视图时的排查步骤,包括检查依赖和配置文件,特别强调了检查`template-loader-path`路径配置,确保ftl文件位于该路径下
问题描述
idea无法解析MVC视图
分析
1.检查依赖:
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-freemarker</artifactId>
</dependency>
2.检查配置文件:
注意template-loader-path的路径配置,看你的ftl文件是否在该文件夹下
freemarker:
cache: false
charset: utf-8
expose-request-attributes: true
expose-session-attributes: true
suffix: .ftl
template-loader-path: classpath:/templates/
resources:
static-locations: classpath:/static/
总结
以上为个人经验,希望能给大家一个参考,也希望大家多多支持脚本之家。
相关文章
SpringBoot项目属性配置(application.properties、yml和yaml)
SpringBoot支持多种配置文件格式,包括application.properties、yml和yaml,application.properties是键值对结构,常用于简单配置,如设置服务器端口,yml和yaml文件格式相同,使用缩进表示层级,适合复杂配置,下面就来详细的介绍一下2025-08-08


最新评论