I have this example with the p:fileDownload component at my app:
JAVA:
Code: Select all
public MyBean ...{
private StreamedContent file;
public void processFile(){
...
this.file= .. a processed File;
....
}
}
// getters and setters
Code: Select all
<h:commandButton actionListener="#{myBean.processFile}" >
<p:fileDownload value="#{myBean.file}" />
</h:commandButton>
Code: Select all
java.lang.NullPointerException
at org.primefaces.component.filedownload.FileDownloadActionListener.processAction(FileDownloadActionListener.java:53)
at javax.faces.event.ActionEvent.processListener(ActionEvent.java:88)
at javax.faces.component.UIComponentBase.broadcast(UIComponentBase.java:772)
at javax.faces.component.UICommand.broadcast(UICommand.java:300)
at javax.faces.component.UIData.broadcast(UIData.java:912)
at org.primefaces.component.datatable.DataTable.broadcast(DataTable.java:574)
at javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:775)
If I just wanna display a message to the user...
Where should I catch it?
This is my first post, I hope you have enough information.Thanks.