I have file locate inside WebContent/WEB-INF/resources/file/theFile.pdf
, 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 h:outputLink
to download the pdf file but no luck, the console output show me this error:
File not found: /pages/resources/file/theFile.pdf
How can tell JSF to remove the /pages
and begin with the /resources
as my file was sit inside resources folder.
This is the download code:
<h:outputLink value="resources/file/theFile.pdf">
<h:graphicImage library="images" name="pdf.jpg" style="border:none"/>
</h:outputLink>