• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Servlet Response different from IE to Netscape

 
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
As David Hibbs suggested, I am posting the following problem here:
Using the HttpServletResponse to send either PDF or xls file to the user. It is working fine in Netscape. However, in IE, the browser will display error on opening the file when traffic is heavy on the site. Why is that?
The server is Websphere.
I am writing direct to the response. Here is code:
ServletOutputStream outStream = null;
try {
if (fileType.equals("xls"))
response.setContentType("application/vnd.ms-excel");
else if (fileType.equals("pdf"))
response.setContentType("application/pdf");
response.setContentLength(report.length);
outStream = response.getOutputStream();
outStream.write(report);
} catch (Exception e4) {
System.out.println("Can not output"+e4.getMessage());
}
finally {
if (outStream != null) {
try {outStream.close();}catch(Exception e5){}
}
}
 
Ranch Hand
Posts: 365
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What is the error displayed? Also, does this process take a while to perform? In other words, are you doing something other than this like generating the files in question using a specific API or doing some database op that takes a long time to process? Perhaps the browser is timing out when streaming the file. Netscape's timeout setting may be longer than IE's but I am just grasping here.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic