Duvida como aparecer na pagina jsp
uma planilha criada.
No teste que está abaixo chiama o servlet aparece a mensagem Request
mas não mostra a planilha na pagina jsp.
Alguém já passou por isso ???
public class HSSFCreate extends HttpServlet {
public void init(ServletConfig config) throws ServletException {
super.init(config);
}
public void destroy() {
}
/** Processes requests for both HTTP GET and POST methods.
* @param request servlet request
* @param response servlet response
*/
protected void processRequest(HttpServletRequest request,
HttpServletResponse response) throws ServletException, IOException {
System.out.println("Request ..");
POIFSFileSystem fs=new POIFSFileSystem(new FileInputStream("C:/tmp/bi/quotas/planilha/backup.xls"));
HSSFWorkbook wb=new HSSFWorkbook(fs);
response.setContentType("application/vnd.ms-excel");
OutputStream out = response.getOutputStream();
wb.write(out);
}
/** Handles the HTTP <code>GET</code> method.
* @param request servlet request
* @param response servlet response
*/
protected void doGet(HttpServletRequest request,
HttpServletResponse response) throws ServletException, IOException {
processRequest(request, response);
}
/** Handles the HTTP POST method.
* @param request servlet request
* @param response servlet response
*/
protected void doPost(HttpServletRequest request,
HttpServletResponse response) throws ServletException, IOException {
processRequest(request, response);
}
/** Returns a short description of the servlet.
*/
public String getServletInfo() {
return "Example to create a workbook in a servlet using HSSF";
}
}