繁体   English   中英

Spring-Boot Thymeleaf以html格式加载图像,列表不显示

[英]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.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM