title: Need tutorial on implementing a JSF ResourceHandler
body: <p>My application needs to implement dynamic images, where a browse can get served a JPG or PNG out of my data base. </p>
  
  <p>I have been <a href="https://stackoverflow.com/questions/9546101/own-resourcehandler-to-stream-images-from-db">reading this thread</a> and am not getting very far in learning from it.  Can someone provide a link to a tutorial about how to implement a ResourceHandler.</p>
  
  <p>Having looked through all the books Amazon offers on JSF 2.0, none of them seem to cover this topic.  Thanks in advance.</p>
  
  <p>UPDATE:  This question is withdrawn since I took a different path to the solution, which was simply to implement a Servlet to serve up the images.  What I was asking was how to get the JSF Facelets Servlet to response to a GET with a "image/png" media type.  Although it seems that you can do that through the ResourceHandler facility, I found that implementing a Servlet is easier, and what's more you have more flexibility with regard to the resource path name.</p>
  
  <p>What I was also surprised about is that although the Servlet doesn't have a FacesContext when it processes a Request, you CAN inject beans or resources that are CDI managed. This gave me the same access to the JPA back end as the rest of the application.  So my issue is resolved.</p>