title: blob image render in spring mvc 3.0
body: <p>I am trying to read blob type image which is coming from Database. My method in controller. Only Image file is displaying on JSP nothing else</p>
  
  <pre><code>@RequestMapping(value = "/showDetails")
  public ModelAndView showDetails(@RequestParam("doc") int id,
          HttpServletResponse responce) {
      ModelAndView mView = new ModelAndView();
      File file = documentDao.getFileDetail(id);
      byte[] bytes = null;
      try {
          OutputStream op = responce.getOutputStream();
          int length = (int) file.getContent().length();
          bytes = file.getContent().getBytes(1, length);
          op.write(bytes);
          op.flush();
          op.close();
          responce.setContentType("image/gif");
          mView.addObject("image", op);
      } catch (Exception e1) {
          e1.printStackTrace();
      }
  
      mView.addObject("file", file);
      mView.setViewName("filedetails");
      return mView;
  }
  </code></pre>
  
  <p>The above method in my controller class. And I want to render image as well as some text on JSP. But only image is coming in Browser.</p>