title: display image from database on page load in servlet
body: <p>I would like to show an image when the page loads in a servlet. Considering that this page is an html page, I don't really understand how the image to be displayed can be mentioned programatically(say, for example database.</p>
  
  <p>Had it been a servlet, I would have just done something like the following which shows an image once the button is clicked. But how do I do the same for an html? </p>
  
  <pre><code>protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
          // TODO Auto-generated method stub
          response.setContentType("text/html");
  
            PrintWriter out = response.getWriter();
  
            out.print("&lt;HTML&gt;");
            out.print("&lt;HEAD&gt;&lt;TITLE&gt;Upload Image&lt;/TITLE&gt;&lt;/HEAD&gt;");
            out.print("&lt;BODY&gt;");
  
            out.print("&lt;img src='images/imagethree.jpg' alt='image' /&gt;");
            out.print("&lt;img src='images/imageone.jpg' alt='image' /&gt;");
            out.print("&lt;input type=\"submit\" value=\"select\"&gt;");
  
            out.print("&lt;/BODY&gt;");
            out.print("&lt;/HTML&gt;");
            out.close();
      }
  </code></pre>