I am trying to retrieve csv file from JSF managed bean.
Right now I am doing it this way,
CsvController: Bean which responds output with content type text/csv.
samplecsv.xhtml: A webpage which contains the code:
#{csvController.generateReport()}
When I browse this page on browser, a download dialog opens which enables downloading the csv file.
report.xhtml:
Webpage which downloads that csv:
d3.csv('http://mysite/samplecsv.xhtml');
Is there a way to get rid of samplecsv.xhtml and directly retrieve csv file from bean in report.xhtml?
Something like d3.csv('http://mysite/csvController/report')
would be perfect