代码之家  ›  专栏  ›  技术社区  ›  theanilpaudel

Spring Boot在/resources/static/images文件夹中找不到映像

  •  0
  • theanilpaudel  · 技术社区  · 7 年前

    <body>
        <div class="container">
            <div class="row justify-content-center">
                <div class="col-md-4"><img class="img-fluid" src="../static/images/zep.png" /></div>
            </div>
            <div class="row justify-content-center">
                <div class="col-md-12 text-center"><h1>Coming Soon.</h1></div>
                <!-- <div class="col-md-12 text-center"><p>Subscribe to our newsletter and stay tuned</p></div> -->
            </div>
            <!-- <div class="col-md-12 text-center"><button class="btn btn-custom">Subscribe</button></div> -->
        </div>
    </body>
    

    这是我的文件夹结构 enter image description here

    所以当我运行它时

    Failed to load resource: the server responded with a status of zep.png:1 404 ()
    

    我做错什么了?任何帮助都将不胜感激。谢谢

    0 回复  |  直到 7 年前
        1
  •  2
  •   Andy Wilkinson    7 年前

    static 在 img 标签 src . 放置在中的资源 src/main/resources/static 将从您的申请表的根目录开始提供。这意味着 src/main/resources/static/images/zep.png /images/zep.png