title: How to display list of image from database using jsp Servlet
body: <p>As I am using Image datatype in sql database. I am able to display one image using jsp servlet. However, what if I want to retrieve list of images to be display using servlet? </p>
  
  <p>here is my single image display method: </p>
  
  <pre><code>    byte barray[]  = photo.getImage();
      response.setContentType("image/jpg");
      response.setContentLength(barray.length);
      response.getOutputStream().write(photo.getImage());
      response.getOutputStream().flush();
      response.getOutputStream().close(); 
  </code></pre>
  
  <p>JSP :</p>
  
  <pre><code>&lt;img src=" ${pageContext.servletContext.contextPath }/getPhotoServlet " &gt;&lt;/img&gt;
  </code></pre>