• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Export to Excel in JSF -An Issue

Vijay aRaghavan
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, I am trying to implement this feature and I've developed my app using Java Studio Creator.

1) Scenario and Issue:

Page1.jsp/Page1.java ---> I've created a Export to Excel link and I am navigating it to another JSF(Exceldisp.jsp/Exceldisp.java) with table columns mapped thats supposed to deliver the table present in Page1(JSF) in an Excel format

I use a alot many filter components and a submit button in the Page1.jsf apart from the [Export to Excel] link

Basically these four lines of code are added in my Exceldisp JSF.

res = (HttpServletResponse)getExternalContext().getResponse();

res.setHeader("Content-Disposition", "attachment; filename=Report.xls");


After I display some report in the browser from Page1.jsf and click Export to Excel and download the report in a excel format a problem arises..

When I click my submit button again - a file dialog box opens and once again
I am receiving the next report in the excel format- for a submit action

Even when I change the filter parameters and try clicking the submit button of page 1 its happenning again.

I explicity tried to change the response paramters of Page1.jsp back to application/url-from encoded.. yadda yadda still no luck.

Is this an issue with the browser or any way can I avoid that
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic