jsf 1.2 - Same method opening again in jsf -


I have written a method in JSF managed bean to export a table in Excel. This method is right, when there is a problem after calling this method, if any other method is called this export method, then it is only being called.

This is my export for Excel method

  Public Zero Exports HtmlTableToExcel () throws IOException {FacesContext reference = FacesContext.getCurrentInstance (); HttpServletResponse response = (HttpServletResponse) reference .getExternalContext (). GetResponse (); Response.setContentType ("application / vnd.ms-excel"); Response.setHeader ("content-displacement", "attachment; file name = csopdetails.xls"); Response.setHeader ("Pagera", "No-Cash"); Try {OutputStream OS = response.getOutputStream (); // code here} wb.write (response.getOutputStream ()); // wb.write (); // os.flush (); Os.close (); } Hold (IOException ioe) {// handle exception ...}  

Can anyone help me in organizing this problem.


Comments