[英]Spring-Boot Thymeleaf Load image in html-form with list doesnt display
我正在使用Spring-Boot Thymeleaf上傳菜單(圖像)制作小應用程序我的上傳菜單正在工作,所以列表菜單上傳,但問題是當我嘗試從netbeans中的靜態文件夾顯示我的圖像到網頁時我的文件名是出現但我的形象沒有。 怎么會這樣?
我從listmenu獲得了我之前創建的filedata圖像。
//這是我的list.html:
<table border='1' width='50%' height='100%'>
<tr th:each="files: ${fileName}">
<td th:text="${files}"/>
<td><img src="../static/img/ "width="100"
th:src="@{img/' + files + '}"/></td>
</tr>
我希望網頁上的輸出是我的文件名(來自圖像)和圖像顯示。
你的:src接縫錯了。 它應該是
<img th:src="@{'/img/'+ ${files}}">
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.