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]>

Reply via email to