title: CSS Background Image From Database
body: <p>How can I use an image from a database as a CSS background-image?
  I can get an image from the resource library (file), but not the DB.</p>
  
  <pre><code>&lt;h:outputStylesheet&gt;
     body {
        background-image:url("#{resource[imageBean.getImage().getUrl()]}"); 
     }
  &lt;/h:outputStylesheet&gt;
  </code></pre>
  
  <p>resource[imageBean.getImage().<strike>getUrl()</strike></p>
  
  <p>Is there a way I can get the URL of the image that is in the imageBean?</p>
  
  <p>I display DB images using an application scoped bean: 
  <a href="https://stackoverflow.com/questions/16934663/displaying-images-from-mysql-database-in-jsf-datatable">Displaying images from MySQL database in JSF datatable</a></p>