Last week, we had the author of TDD for a Shopping Website LiveProject. Friday at 11am Ranch time, Steven Solomon will be hosting a live TDD session just for us. See for the agenda and registration link
  • 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
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Frits Walraven
Bartenders:
  • Piet Souris
  • Himai Minh

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.
 
F is for finger. Can you stick your finger in your nose? Doesn't that feel nice? Now try this tiny ad:
ScroogeXHTML - fast RTF to HTML and XHTML conversion
https://coderanch.com/t/749563/ScroogeXHTML-fast-RTF-HTML-XHTML
reply
    Bookmark Topic Watch Topic
  • New Topic