• 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

displayin word/excel file using jsp

 
Ranch Hand
Posts: 260
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi
i have to display word/excel file using jsp

I have disaplyed the file name from the dir,bt as soon as I click the file name.. it disply in browser bad format..
I have to show this file in its original format say word/excel

I am using jsp & tomcat
 
Sheriff
Posts: 13411
Firefox Browser VI Editor Redhat
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
This seems to be the question du jour.

Your best bet is to create a servlet that can stream the file to the browser.
I've published a real simple one that streams files from the filesystem. It wouldn't take much effort to rework it to stream the image you've generated on the fly.
http://simple.souther.us
Look for SimpleStream.
 
Ranch Hand
Posts: 365
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You can serve the excel file directly as long as you have a mime type set up.

type=application/vnd.ms-excel
extension=xls

Of course the file would need to be in a location where your application server can actually "serve" the file.
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser VI Editor Redhat
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yes, William is right. If you're just serving them up as static files, there is no need to stream them.

In Tomcat, mime types are set up in the global web.xml file located under TOMCAT_HOME/conf.

We've had a lot of people asking how to serve up dynamic content as Excel and Word files this week and conequently, I skimmed your post and jumped to the wrong conclusion.

Sorry about that.
-Ben
 
You can't have everything. Where would you put it?
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic