title: Image Upload and Display in JSP
body: <p>I've learned and implement successfully that how to upload images on server disk with servlet from <a href="http://www.servletworld.com/servlet-tutorials/servlet-file-upload-example.html" rel="nofollow noreferrer">Here</a> and now trying to show the image on another jsp <code>userProfile.jsp</code> with the help of following code :</p>
  <pre><code>&lt;img src=&quot;&lt;jsp:include page='WEB-INF/jspf/profileImage.jspf' /&gt;&quot; height=&quot;175&quot; width=&quot;175&quot; /&gt; 
  </code></pre>
  <p>and code of <code>profileImage.jspf</code> is as follows:</p>
  <pre><code>OutputStream o = response.getOutputStream();
  InputStream is = new FileInputStream(new File(&quot;../files/backPetals.jpg&quot;));
  byte[] buf = new byte[32 * 1024]; 
  int nRead = 0;
  while( (nRead=is.read(buf)) != -1 ) {
      o.write(buf, 0, nRead);
  }
  o.flush();
  o.close();
  return; 
  </code></pre>
  <p>but it does not works..
  Any other ways to display the image from disk on jsp together with other matter on page?
  I've saved my images on <code>/files</code> directories on the application root folder.</p>