This seems to be a known issue with IE.
e.g. the jakarta POI FAQ has the following to say on the topic:

anonymous wrote : 7. I'm trying to stream an XLS file from a servlet and I'm 
having some trouble. What's the problem?
  | 
  | The problem usually manifests itself as the junk characters being shown on 
screen. The problem persists even though you have set the correct mime type.
  | 
  | The short answer is, don't depend on IE to display a binary file type 
properly if you stream it via a servlet. Every minor version of IE has 
different bugs on this issue.
  | 
  | The problem in most versions of IE is that it does not use the mime type on 
the HTTP response to determine the file type; rather it uses the file extension 
on the request. Thus you might want to add a .xls to your request string. For 
example http://yourserver.com/myServelet.xls?param1=xx. This is easily 
accomplished through URL mapping in any servlet container. Sometimes a request 
like http://yourserver.com/myServelet?param1=xx&dummy=file.xls is also known to 
work.
  | 
  | To guarantee opening the file properly in Excel from IE, write out your 
file to a temporary file under your web root from your servelet. Then send an 
http response to the browser to do a client side redirection to your temp file. 
(Note that using a server side redirect using RequestDispatcher will not be 
effective in this case)
  | 
  | Note also that when you request a document that is opened with an external 
handler, IE sometimes makes two requests to the webserver. So if your 
generating process is heavy, it makes sense to write out to a temporary file, 
so that multiple requests happen for a static file.
  | 
  | None of this is particular to Excel. The same problem arises when you try 
to generate any binary file dynamically to an IE client. For example, if you 
generate pdf files using FOP, you will come across many of the same issues.
  | 

View the original post : 
http://www.jboss.org/index.html?module=bb&op=viewtopic&p=3879249#3879249

Reply to the post : 
http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=3879249


-------------------------------------------------------
This SF.Net email is sponsored by Yahoo.
Introducing Yahoo! Search Developer Network - Create apps using Yahoo!
Search APIs Find out how you can build Yahoo! directly into your own
Applications - visit http://developer.yahoo.net/?fr=offad-ysdn-ostg-q22005
_______________________________________________
JBoss-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to