how to give servlet in <img> src attribute?
<p>I use the following code to set the src attribute in image tag  from the servlet.but it's not working can any one help me to do this.</p>

<pre><code>&lt;img src="./imageDisplayProcess.do" alt="hai" width="117" height="160"/&gt;
</code></pre>

<p><strong>Servlet</strong></p>

<pre><code>protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        // TODO Auto-generated method stub
        try{

                Class.forName("com.mysql.jdbc.Driver");
                Connection connection =DriverManager.getConnection("jdbc:mysql://localhost:3306/raptor1_5","root","");
                Statement st1=connection.createStatement();
                ResultSet rs1 = st1.executeQuery("select Qimg from tbl_MatchImgToImg where C_code='R201AEV01'");
                String imgLen="";
                if(rs1.next()){
                    imgLen = rs1.getString(1);
                    System.out.println(imgLen.length());
                }   
                rs1 = st1.executeQuery("select Qimg from tbl_MatchImgToImg where C_code='R201AEV01'");
                if(rs1.next()){
                    int len = imgLen.length();
                    byte [] rb = new byte[len];
                    java.io.InputStream readImg = rs1.getBinaryStream(1);
                    int index=readImg.read(rb, 0, len); 
                    System.out.println("index"+index);
                    st1.close();
                    response.reset();
                    response.setContentType("image/jpg");
                    response.getOutputStream().write(rb,0,len);
                    response.getOutputStream().flush();             
                }



    }
        catch(Exception e){
            System.out.println(e);
        }
        }
</code></pre>

<p><strong>web.xml</strong></p>

<pre><code>&lt;servlet&gt;
    &lt;servlet-name&gt;imageDisplayProcess&lt;/servlet-name&gt;
    &lt;servlet-class&gt;get.imageDisplayProcess&lt;/servlet-class&gt;
  &lt;/servlet&gt;
  &lt;servlet-mapping&gt;
    &lt;servlet-name&gt;imageDisplayProcess&lt;/servlet-name&gt;
    &lt;url-pattern&gt;/imageDisplayProcess.do&lt;/url-pattern&gt;
  &lt;/servlet-mapping&gt;
</code></pre>