title: Spring MVC Image Controller, to display Image Bytes in JSP
body: <p>I have a Spring MVC application, and one of the JSPs must show images coming from a database.</p>
  
  <p>The images are stored in the DB as Blobs.</p>
  
  <p>What is the easiest way to display them? What kind of servlet/controller do I need to show on the JSP the image bytes? Should be an easy question, but I haven't been able to find a full solution anywhere.</p>
  
  <p>My understanding is that I need a separate controller, say ImgController/id=, which will display the image bytes based on a request parameter, and then in my JSP I can have img src="ImgController/id...". But how do I implement and wire this controller?</p>
  
  <p>Any help or example would be really appreciated. Thanks a lot.</p>