How to make a simple JSF download?
I have a list of attachments in <p:dataTable>
and would like to implement a simple download.
I implemented with <a href>
, the link on the file name was created, but when I click it it just does not download.
I would not like to use any component like <p:fileDownload>
, because I need something very simple and <p:fileDownload>
would have to create a logic to be able to identify types: zip, xls, doc and etc.
As I said, I tried <a href>
as below, the link appears but nothing happens when I click on the link:
<p:column headerText="Nome do Anexo" width="55%">
<a href="${cadastroAtividadeBean.defineCaminhoDownload(anexo.nomeAnexo)}"
title="${anexo.nomeAnexo}">
<h:outputText value="#{anexo.nomeAnexo}" />
</a>
</p:column>
Would anyone have any examples that could help me?