title: Retrieve image from blob via Hibernate (not JDBC)
body: <p>I've found very nice solution of retrieving images from <em>db/blob</em> thanks to <a href="https://stackoverflow.com/questions/2340406/how-to-retrieve-and-display-images-from-a-database-in-a-jsp-page/2341322#2341322">How to retrieve and display images from a database in a JSP page?</a></p>
  
  <p>But this is solution that uses <em>JDBC connection</em> on every image request.</p>
  
  <p>I'm using <em>Spring 3</em> annotations and <em>Hibernate 3</em>. </p>
  
  <p>I tried to do similar thing by my 'imageService', which is autowired by annotation in <em>ImageServlet class</em>, but I got <em>nullPointerException</em>, which means that may <em>imageService</em> is not set by Dependency Injection.</p>
  
  <p>Is there any way how to solve that? I don't like to make single jdbc connection on image request.</p>