-1

I'm trying to display images from my database. It works fine when I want to display my own image using ......<b>Image:</b> <img src="images/uploads/${user.getImage()}" However if I want to display a different user or all users image a blank square appears. I think it may have to do with the <c:forEach> tag but unsure.

 <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>

The name displays fine but not the image! Any help is greatly appreciated!

Luiggi Mendoza
  • 85,076
  • 16
  • 154
  • 332
user2131895
  • 27
  • 1
  • 3

1 Answers1

1

What does the User.getImage() method return?

Also, Try:

<img src="images/uploads/${user.image}"  width="200px" height="150px"/>
NickJ
  • 9,380
  • 9
  • 51
  • 74