I am trying to make a shopping page where I am showing different items available for purchase using the given JSP:
<%
String query ="select * from PRODUCT";
Connection con = ConnectDao.connect();
PreparedStatement ps = con.prepareStatement(query);
ResultSet rs = ps.executeQuery();
%>
<% while(rs.next()){%>
<div class="grid1_of_4">
<img src="/uploads/<%=rs.getString(9) %>" class="img-responsive" alt=""/>
</a>
<h4><a href="#"><%=rs.getString(2) %></a></h4>
<div class="item_add"><span class="item_price"><h6>ONLY $<%=rs.getString(6) %></h6></span></div>
<div class="item_add"><span class="item_price"><a href="#">add to cart</a></span></div>
</div>
</div>
</div>
<%} %>
I have the images stored in the uploads folder inside WebContents of my eclipse project folder. And the corresponding image names are stored in the database(DB2) in the 9th column ( hence rs.getString(9)).
But still I am not being able to fetch the image.