FileDownload

FileDownload is used to stream binary contents like files stored in database to the client. FileDownload is used by attaching it to any JSF command component like button or a link. Additionally presentation of download can be configured with the contentDisposition attribute that takes either "attachment" or "inline" as a value.

Download

Source

<p:commandLink id="downloadLink" value="Download" ajax="false">
	<p:fileDownload value="#{fileDownloadController.file}" />
</p:commandLink>