This week's book giveaways are in the Java EE and JavaScript forums.
We're giving away four copies each of The Java EE 7 Tutorial Volume 1 or Volume 2(winners choice) and jQuery UI in Action and have the authors on-line!
See this thread and this one for details.
The moose likes BEA/Weblogic and the fly likes Opening Excel with JSP Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Products » BEA/Weblogic
Bookmark "Opening Excel with JSP" Watch "Opening Excel with JSP" New topic
Author

Opening Excel with JSP

Jetendra Ivaturi
Ranch Hand

Joined: Feb 08, 2007
Posts: 159
Hi Every body...

I am trying to open an excel sheet from a jsp page using setContentType();

Its opening but its giving garble data... I have also tried using <mime-mapping>, with no luck.

Am using wls 8. could any one suggest an option for this.

Thanks.


SCJP 1.4 & 1.5, SCWCD 1.5. Learn and Let Learn.
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41574
    
  54
What do you mean by "open"? Are you streaming an XLS file to the client? If so, that won't work. JSPs are for text, not for binary content; you need to use a servlet instead. If you're trying to do something else, please describe it in more detail.


Ping & DNS - my free Android networking tools app
Jetendra Ivaturi
Ranch Hand

Joined: Feb 08, 2007
Posts: 159
I have to download the excel sheet. I mean to say am using setContentType(application/vs.ms-excel).

However its working fine in tomcat. Am able to download the excel sheet.

Where as in weblogic it wasn't possible.

My doubt is with content type.

So have use reset() method of response object. Its working fine.

Thanks for your time.

Ulf Dittmer... Is that the right behaviour what am doing?

Kindly suggest, Thanks once again.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: Opening Excel with JSP