Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/jsp/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Jsp <;c:forEach>;使用_Jsp_Servlets_Jstl_El - Fatal编程技术网

Jsp <;c:forEach>;使用

Jsp <;c:forEach>;使用,jsp,servlets,jstl,el,Jsp,Servlets,Jstl,El,我正在尝试显示数据库中的图像。当我想显示时,它可以正常工作 我自己的图像使用……图像: 但是,如果我想显示其他用户或所有用户的图像,则会出现一个空白方块。我认为这可能与标签有关,但不确定 <c:forEach var="user" items="${UserList}"> <p><br><b>Name :</b></p> ${user.getUsername()}<a href="ProfilePage2

我正在尝试显示数据库中的图像。当我想显示时,它可以正常工作 我自己的图像使用……
图像:
但是,如果我想显示其他用户或所有用户的图像,则会出现一个空白方块。我认为这可能与
标签有关,但不确定

 <c:forEach var="user" items="${UserList}">
      <p><br><b>Name :</b></p> ${user.getUsername()}<a href="ProfilePage2.jsp">View Profile Page</a>
      <div id="img2"><b>Image:</b> <img src="images/uploads/${user.getImage()}"  width="200px" height="150px"/></div>
 </c:forEach>


名称:

${user.getUsername()} 图片:

名称显示良好,但图像显示不好!非常感谢您的帮助

User.getImage()方法返回什么

此外,请尝试:

<img src="images/uploads/${user.image}"  width="200px" height="150px"/>


请参阅以了解此代码中的问题。顺便问一下,哪种类型是
user.image
?类型是varchar…谢谢!看起来问题在于/images/uploads/文件夹中不存在图像。请检查html源代码,是否为图像生成了正确的路径?