The method goTo(req,res,Nombre) is NOT necesary and must be deleted. It's my fault with copy and paste. That works for other aplications but not for this. Sorry for the bad code, delete the goTo and all will work.
-----Mensaje original----- De: Michael Zalewski [mailto:[EMAIL PROTECTED]] Enviado el: mi�rcoles, 12 de junio de 2002 5:54 Para: POI Users List Asunto: RE: Open an EXCEL file from IE: An example I'm not understanding the goTo method. After writing the bytes from a HSSFWorkbook, you forward the request (with a closed outputstream) to "Nombre.xls"? This should cause the File Serving Servlet to send the file "Nombre.xls", relative to your web application's document root. Not sure what happens next because you have closed the output stream from the response object. Is it possible that you are getting mixed bytes from the HSSFWorkbook and the File Serving Servlet on Nombre.xls? Or maybe the file serving servlet is overwriting the output stream with an error message like 'Response Output Stream is already closed'? -----Original Message----- From: Andrew C. Oliver [mailto:[EMAIL PROTECTED]] Sent: Tuesday, June 11, 2002 9:58 PM To: POI Users List Subject: Re: Open an EXCEL file from IE: An example Might be able to help more if you ran an org.apache.poi.dev.BiffViewer on the files and compared them. I wonder if this is some kind of little endian big endian thing. What version of POI btw? -Andy Torbert Brian IT56 wrote: >I am using Websphere Application Server 3.5.3 and using the code below. The >excel file opens but it is corrupted and displays a bunch of binary data. >What is strange is when I run this application in VAJ3.5.3's WTE everything >works fine. Does anyone have any ideas? Are there compatibility issues >with POI and WAS 3.5? > >-----Original Message----- >From: Garcia Vazquez, Pedro [mailto:[EMAIL PROTECTED]] >Sent: Thursday, June 06, 2002 4:59 AM >To: POI Users List >Subject: Open an EXCEL file from IE: An example > > >public class mySevlet extends HttpServlet > > >public void doPost(HttpServletRequest req, HttpServletResponse res) throws >ServletException, IOException > > try > > HSSFWorkbook wb = myclass.dostuff(); > > res.setContentType("application/vnd.ms-excel"); > OutputStream outN = res.getOutputStream(); > wb.write(outN); > outN.flush(); > > } catch(Exception e) > { > System.out.println("Excepcion " + e); > } > > Nombre="name.xls"; // This not necesary > > goTo(req,res,Nombre); > } > > > public void goTo(HttpServletRequest req, HttpServletResponse res, String >nombre) { > > RequestDispatcher rd = req.getRequestDispatcher( nombre ); > try { > rd.forward(req,res); > } > catch (Exception e) { > System.out.println("ERROR dispatcher " + e); > } > > } > >} > >-- >To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> >For additional commands, e-mail: <mailto:[EMAIL PROTECTED]> > > > > -- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]> -- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]> ----------------------------------------------------------------- Este correo electr�nico y, en su caso, cualquier fichero anexo al mismo, contiene informaci�n de car�cter confidencial exclusivamente dirigida a su destinatario o destinatarios. Queda prohibida su divulgaci�n, copia o distribuci�n a terceros sin la previa autorizaci�n escrita de Indra. En el caso de haber recibido este correo electr�nico por error, se ruega notificar inmediatamente esta circunstancia mediante reenv�o a la direcci�n electr�nica del remitente. ----------------------------------------------------------------- The information in this e-mail and in any attachments is confidential and solely for the attention and use of the named addressee(s). You are hereby notified that any dissemination, distribution or copy of this communication is prohibited without the prior written consent of Indra. If you have received this communication in error, please, notify the sender by reply e-mail. ----------------------------------------------------------------- -- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
