title: Accessing DB via JPA in Wicket IResource?
body: <p>I want to implement an <code>DynamicImageResource</code> which will be mounted in a Wicket 6.7/Spring 3.2/JPA 2 application. This <code>DynamicImageResource</code> shall retrieve information based on input parameters and create a response.</p>
  
  <p>The question is: How can i access the DB from within <code>DynamicImageResource.getImageData(...)</code>? I can't inject a @PersistenceContext<code>enter code here</code> or a DAO via <code>@SpringBean</code>. My last resort would be a static PersistenceContextFactory.</p>
  
  <p>Any better ideas? Or best practices?</p>