title: Wicket Dynamic Image URL
body: <p>Short question:
  I need to turn a dynamic image pulled from a database into a URL without adding a component to the displaying page (such as using a NonCachingImage) using Wicket.</p>
  
  <p>The perfect solution (that I've implemented in other Frameworks) is simply to create a page that takes the image ID as a url parameter and renders the image to the response stream.  Unfortunately Wicket's Page class extends MarkupContainer, which revolves around MarkupStreams.  MarkupStreams aren't very conducive to rendering byte data directly.</p>
  
  <p>Long question:
  I'm using Wicket 1.4.0, running in Tomcat 6.0.18.  The image is stored in a Postgres database, retrieved via JDBC.  The image needs to be rendered by a third party API that only accepts image URLs.  I have a model object that contains the byte data, mime type, and a Resource object that can pull the model from the DB and add it to a response stream.</p>
  
  <p>Any ideas?</p>