Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Export xlsx file in JSF 2 / Icefaces 3 application  RSS feed

 
Ousmane Mbinte
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I try to export data in an xlsx file in my JSF 2 / Icefaces 3 application. For this i create a workbook, init rows and cells and write it in the outputstream of the response but i have no result. Only a hourglass. I have ajax call in my page but not on the export button.

In the Firebug when i look the response i have data.

Action in ManagedBean :




button



pom.xml




Request in Firebug :



Response in Firebug :



 
Tim Holloway
Bartender
Posts: 18705
71
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I strongly discourage making JSF code output non-HTML content such as PDF, XLS, or Word DOC formats. Do that part of your webapp using a regular servlet or JSP(X).

The FacesServlet invests a lot of effort into conditioning its output stream to be JSF-friendly HTML and this complicates code that doesn't want to output JSF-friendly HTML.
 
Ousmane Mbinte
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have the solution, the problem is that you can not download a file with Ajax. It must be disable like this for Icefaces :

 
Tim Holloway
Bartender
Posts: 18705
71
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That is true, but I still don't recommend generation of non-HTML content using JSF. JSF doesn't mind if you use a servlet or JSPX prototype to create XLSX.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!