【问题标题】:spring boot application with gradle build cannot find index.html带有gradle build的spring boot应用程序找不到index.html
【发布时间】:2015-08-03 22:34:48
【问题描述】:

我有一个带有 gradle build 的 spring boot 应用程序。

我在 main/resources 下有 static/index.html。当服务器启动时,尝试访问 index.html 返回 404,抱怨找不到 URI 的映射。

有什么见解吗?

【问题讨论】:

    标签: angularjs gradle spring-boot


    【解决方案1】:

    如果您在main/resources 中有静态资源,那么它们位于错误的位置。它们应该在src/main/resources 中,即您的index.html 文件的路径应该是src/main/resources/static/index.html

    【讨论】:

    • 是的,这正是它所在的位置。在src/main/resources/static/index.html下,但是打包后无法访问
    猜你喜欢
    • 2015-10-26
    • 1970-01-01
    • 1970-01-01
    • 2016-12-18
    • 2018-03-09
    • 2016-04-16
    • 1970-01-01
    • 2018-09-12
    • 2020-08-26
    相关资源
    最近更新 更多