java

关注公众号 jb51net

关闭
首页 > 软件编程 > java > 无法解析MVC视图

无法解析MVC视图的解决方案

作者:追梦梓辰

文章介绍了当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/

总结

以上为个人经验,希望能给大家一个参考,也希望大家多多支持脚本之家。

您可能感兴趣的文章:
阅读全文