• 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 - POI - Excel

 
Ranch Hand
Posts: 42
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have a servlet running under Sun Java Web Server 6.1 that uses the apache POI library to create an excel spreadsheet, then stream it back to the browser . This works fine unless the servlet takes more than 60 seconds to do it's processing. If it takes more than 60 seconds, the excel is never served to the browser. However; I know the servlet finishes successfully with no errors. (I have logging enabled.) I can't find any web server settings or defaults that would seem to control this. Is this a client browser thing? It happens with both IE and FireFox.
 
Marshall B Thompson
Ranch Hand
Posts: 42
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
This happens with both IE and Firefox as the browser. I've tried several things, none of which solve d the issue: excel is not returned to browser if processing server-side takes more than 60 seconds.

Things I tried:
1. Set response headers first. I set content type, but I can't set content length until I create the spreadsheet (takes 60+ seconds). No luck.
2. add a cookie every 10 seconds or so, hoping that would somehow keep the connection alive. No luck.
3. Saved the excel to server file system before streaming it back to browser, does not solve the time issue.
4. I wrote my own client that connects via http to the url that would return an excel, it has the same 60 second issue.

Elsewhere have seen suggestions that setting content length up front is the way to go. But, I don't know the content length until I spend the 60+ seconds creating the content.

I may have to resort to having the user enter their email address on the web page and mailing the excel to them when it is finished. Most requests take a few seconds, the 60+ second request is an exception.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic