I have generated the Excel report using Apache POI. What I want now, I want to send this to the browser for download. My JSP is as follows.
<html>
<head><title> Excel Generator</title>
</head>
<body>
<a href="../houseHoldReportGenCtr">generate report</a>
</body>
</html>
Here is my servlet code
protected void processRequest(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
String report_path=request.getSession().getServletContext().getInitParameter("REPORT_PATH");
HouseHoldReportGenerator report = new HouseHoldReportGenerator("HOUSE_HOLD",attrStr_,dbParam);
report.Write_Report___(report_path, dbParam);
System.out.println("path-->"+report_path+report.getFileName_());}
I have my report generation java class as HouseHoldReportGenerator. It generates the report. But What I want from one click on the link in jsp page I want it to be generated and downloaded. I can get the report destination also.