Img not showing usage of Thymeleaf and Springboot

I use thimeleaf with a spring brush

I cannot view images in an HTML file. I tried all different ways to do the same in thimeleaf, but no luck.

Here is my project folder

Src / core / resources

Patterns

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> 
+8
spring-boot thymeleaf
source share
1 answer

When configuring the default boot, your images (and other static materials) should be below src/main/resources/static . For example, to serve content from /images , put the files in src/main/resources/static/images

+11
source share

All Articles