img not showing using Thymeleaf and Springboot

spring-boot, thymeleaf

Solution

With Boot's default configuration, your images (and other static content), need to be beneath `src/main/resources/static`. For example, to serve content from `/images` put the files in `src/main/resources/static/images`

Problem

I am using thymeleaf along with springboot I am not able to view any images in my HTML file. I have tried all different ways of doing the same in thymeleaf but no luck. Here is my project folder structure ``` src └─── main └─── resources ├─── templates ├─── css └─── images ``` HTML File ``` <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> ```

Original source