Local reading springboot picture

As used herein, it is Springboot official recommended thymeleaf (one kind of page template technology)

First-dependent increase in the pom file

<dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-thymeleaf</artifactId>
</dependency>

 

Springboot project file contains templates and static resources such as

Where the templates stored html interface, static storage css, js files, etc.

Want to read pictures, create images folder under static file, into the picture.

May be in the browser address bar enter localhost: 80880 / images / xxx.jpg, pages can be displayed at this time that is the correct path.

Html interface when calling src = "images / xxx.png / jpg"

At this point you can successfully call.

Guess you like

Origin www.cnblogs.com/lfz1211/p/11161832.html