title: How to make a download file in JSF 2.0?
body: <p>I have file locate inside <code>WebContent/WEB-INF/resources/file/theFile.pdf</code>, may I know how can I download the file that will show a regular download popup dialog or render it in the webpage (either one will do as long as the simplest way to go) when user click on the link of a page? I am using JSF2.0, and currently using <code>h:outputLink</code> to download the pdf file but no luck, the console output show me this error:</p>
  
  <pre><code>File not found: /pages/resources/file/theFile.pdf
  </code></pre>
  
  <p>How can tell JSF to remove the <code>/pages</code> and begin with the <code>/resources</code> as my file was sit inside resources folder.</p>
  
  <p>This is the download code:</p>
  
  <pre><code>&lt;h:outputLink value="resources/file/theFile.pdf"&gt;
    &lt;h:graphicImage library="images" name="pdf.jpg" style="border:none"/&gt;
  &lt;/h:outputLink&gt;
  </code></pre>