Just provide an URL with a valid extension and register if necessary the extension with a content type by <mime-mapping>
in web.xml
.
E.g. the following link which is ultimately produced by JSF regardless of components you use:
<a href="file.csv">Download</a>
with
<mime-mapping>
<extension>csv</extension>
<mime-type>text/csv</mime-type>
</mime-mapping>
Note that the servlet container has by default already a whole list of mime mappings in its own web.xml
, among others CSV. Only for example OpenXML Office documents (docx, xlsx, etc) and HTML5 image formats (SVG) may need to be registered manually.