php ??? Xigua? ? ???? Thymeleaf? ???? HTML ???? ???? ???? ??? ?????. Thymeleaf? HTML ????? ?? ???? ??? ? ?? ??? ?? ???? ?? ? Java ??? ?????. ??? ??? ? ???? ???? ?? ???? Thymeleaf? ??? ??? ???? ?? ?????? ??? ??? ?????. ?? ?????? Thymeleaf ??? ???? ???? ???? ???? ???? ??? ?????. ????? ??? ????? ? ????? HTML ???? ???? ?? ???? ? ??? ??? ?????.
?? ??
? ??? ? ??? ??? HTML ???? ???? ???? ???? ???? ???? ????
?? ??? ??? ?????:
?????? ??? API? ??? ?????.
??????? ??:
?????? ?? ??? ?? Alt? ????...
?? ??
?? 1: ??? ???? ??
?? ??? ???? ?? src/main/resources
的任何內(nèi)容都會(huì)復(fù)制到類路徑中。因此,您不應(yīng)在代碼中引用 src/main/resources
? ?? ???? ??? ?? ??? ??? ? ????.
???? ???? ??? ??? ? ??? ?? ??? jar ??? ???? ??? ??? ?????.
??? ?????? ????? ??? ?? ?? ???? ???.
??????? ???? ???? ?? ???? ????? ??? ???? ?? ??? ????.
filesystemresource
代替 bytearrayresource
:
??? ???? ???? ???? ?? ?? ?????? classpathresource
???? ???? ? ??? ??? ?? ????.
?? ?? ????. ????? ??? ???? ? ???? ???? ??? ??? ????? ???? ??? ?? classpath:static/
文件夾或 classpath:public/
文件夾中的所有內(nèi)容都已經(jīng)在網(wǎng)絡(luò)。所以通常情況下,您的圖像已經(jīng)可以在 http://localhost:8080/logo.png
? ?????.
??? ????? ?? ???? ???? ??? ??? ? ????.
?? 2: ??? ???? ??
??? ? ?? ???? ?????. ?? @{/api/v1/logo}
或 @{src/main/resources/static/logo.png}
? ???? ???? ???? ????.
????? @{path/to/file}
解釋為上下文相關(guān) url,因此它唯一做的就是在上下文路徑前面添加上下文路徑(如果有的話)并期望該文件在 http://localhost:[serverport ]/[contextpath]/path/to/file
.
??? ??? ??? ?? ???? http://localhost:8080/logo.png
上找到,因此,您應(yīng)該使用 @{/logo.png}
:
? ??? ???? ??? ??? ?????.
- ?? ??? ?? ???? ??? ???
src/main/resources
???? ??? ? ????. - Spring Boot?
classpath:static/
或classpath:public/
??? ???? ???? ???? ??? ???? ? ????.
? ??? Thymeleaf? ???? HTML ???? ???? ???? ??? ??????? ?? ?????. ??? ??? PHP ??? ????? ?? ?? ??? ?????!

? AI ??

Undress AI Tool
??? ???? ??

Undresser.AI Undress
???? ?? ??? ??? ?? AI ?? ?

AI Clothes Remover
???? ?? ???? ??? AI ?????.

Clothoff.io
AI ? ???

Video Face Swap
??? ??? AI ?? ?? ??? ???? ?? ???? ??? ?? ????!

?? ??

??? ??

???++7.3.1
???? ?? ?? ?? ???

SublimeText3 ??? ??
??? ??, ???? ?? ????.

???? 13.0.1 ???
??? PHP ?? ?? ??

???? CS6
??? ? ?? ??

SublimeText3 Mac ??
? ??? ?? ?? ?????(SublimeText3)