img没有显示使用Thymeleaf和Springboot

kom*_*hia 12 thymeleaf spring-boot

我正在使用百日咳和springboot

我无法在HTML文件中查看任何图像.我尝试过各种不同的方式在百里香中做同样但没有运气.

这是我的项目文件夹结构

 src
????  main
    ????  resources
        ????  templates
        ????  css
        ????  images
Run Code Online (Sandbox Code Playgroud)

HTML文件

<head>
    <title>Community Bike Share Web Application</title>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width,initial-scale=1.0"/>
    <link rel="stylesheet" th:href="@{/webjars/bootstrap/3.1.1/css/bootstrap.min.css}" href="http://netdna.bootstrapcdn.com/bootstrap/3.1.1/css/bootstrap.min.css" />
</head>

<div>
    <img th:src="@{/images/taiwan_Bicycle_Ride_hd_wallpaper_8.jpg}"
         src="../images/taiwan_Bicycle_Ride_hd_wallpaper_8.jpg" class="img-responsive" alt="Responsive image"/>
</div>
Run Code Online (Sandbox Code Playgroud)

And*_*son 13

使用Boot的默认配置,您的图像(和其他静态内容)需要位于下方src/main/resources/static.例如,提供/images放入文件的内容src/main/resources/static/images