Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   Java (http://www.velocityreviews.com/forums/f30-java.html)
-   -   Viewing Excel files using JSP (http://www.velocityreviews.com/forums/t138561-viewing-excel-files-using-jsp.html)

BenJose 11-20-2004 01:56 AM

Viewing Excel files using JSP
 
Iam using a simple webpage to view/download excel files. But for some
reason I use the <a href> tag to point to the excel file and it shows
up garbled. I tried altering the content type and also did some tweaks
but nothing works... Any pointers in this regards ??

Iam using a Apache Tomcat server.

This is the script itself:
<html>

<head>

<meta http-equiv="Content-Language"
content="application/vnd.ms-excel">
<meta http-equiv="Content-Type" content="application/vnd.ms-excel;
charset=windows-1252">

<title>Maine Educational Assessment</title>
<style type="text/css">
<!--
..style1 {font-size: 10px}
-->
</style>

<!-- End of: /portal/sliverheader/sliverhead.html -->

</head>
<body marginheight="0" marginwidth="0">

<a href="tst.xls">Excel Tst</a>

</body>

</html>

-Ben

Tony Morris 11-20-2004 02:01 AM

Re: Viewing Excel files using JSP
 
"BenJose" <benjose@hotmail.com> wrote in message
news:621f2639.0411191756.bb0a45c@posting.google.co m...
> Iam using a simple webpage to view/download excel files. But for some
> reason I use the <a href> tag to point to the excel file and it shows
> up garbled. I tried altering the content type and also did some tweaks
> but nothing works... Any pointers in this regards ??
>
> Iam using a Apache Tomcat server.
>
> This is the script itself:
> <html>
>
> <head>
>
> <meta http-equiv="Content-Language"
> content="application/vnd.ms-excel">
> <meta http-equiv="Content-Type" content="application/vnd.ms-excel;
> charset=windows-1252">
>
> <title>Maine Educational Assessment</title>
> <style type="text/css">
> <!--
> .style1 {font-size: 10px}
> -->
> </style>
>
> <!-- End of: /portal/sliverheader/sliverhead.html -->
>
> </head>
> <body marginheight="0" marginwidth="0">
>
> <a href="tst.xls">Excel Tst</a>
>
> </body>
>
> </html>
>
> -Ben


Which has what to do with Java?

--
Tony Morris
http://xdweb.net/~dibblego/



shakah 11-20-2004 01:21 PM

Re: Viewing Excel files using JSP
 
You probably have to add Excel to Tomcat's MIME types in order for it
to send the correct response header.

I think you just have to add the following to the webapp's web.xml (as
a child of the web-app tag):

<mime-mapping>
<extension>xls</extension>
<mime-type>application/msexcel</mime-type>
</mime-mapping>


Kaushiksaha05 05-20-2010 05:22 AM

shakah,

Thank you .It's work....in Bea Weblogic server also....Thank you very much....


All times are GMT. The time now is 03:51 AM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.