Hi All,
I am using the following code to generate a downloable CSV file in one of the
JSF projects:
FacesContext fc = FacesContext.getCurrentInstance();
HttpServletResponse response = HttpServletResponse)fc.getExternalContext().getResponse();
response.setContentType("application/csv");
response.setHeader("Content-disposition", "attachment;
filename= Sample_Report.csv");
List list = (List) this.getSessionBean1().getDownloadFile();
ServletOutputStream out = response.getOutputStream();
out.println("Country");
for (int i=0;i<list.size();i++){
out.println(list.get(i).toString());
}
out.close();
fc.responseComplete();
Now my requirement is, I want to refresh the page after above code is executed and file download popup window has come up. But currently my page is not getting refreshed after the file download popup window has come up.
Is there anybody who can help me in getting my page refreshed after the above mentioned code is executed and file download window has popped up.
This is a very critical requirement in my project and we are just stuck here.
Thanks in advance,
Vijay Kumar