• 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

Problem with exporting data from JSP to excel sheet

 
Ranch Hand
Posts: 43
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi
I am trying to export data from my JSP to an excel sheet.
I used the following code in my JSP.


response.setContentType("application/vnd.ms-excel");
response.setHeader("Content-
disposition", "attachment;filename=ExcelAdjustments.xls");
response.setHeader("Pragma", "public");
response.setHeader("Cache-Control", "max-age=0");

It is working fine sometimes but at times it throws the following error.

Error 500: HTTP/1.1 408 Connection timed out while reading request Server: WebSphere Application Server/5.1 Content-Type: text/html Content-Length: 142 Connection: close

If i remove this,
response.setHeader("Cache-Control", "max-age=0"), i am able to save the excel without any error but i am not able to directly open the excel without saving it.


My browser is IE 5
Please advice.

Thanks
Karthik
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic