struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jerome Jacobsen" <jerome.jacob...@gentootech.com>
Subject RE: struts and excel
Date Thu, 06 Jun 2002 15:54:03 GMT
Try adding out.clear() right before changing content type.  Like this:

<%
out.clear();
response.setContentType("application/vnd.ms-excel");
%>

-----Original Message-----
From: yanming lu [mailto:lu_yanming@hotmail.com]
Sent: Thursday, June 06, 2002 11:45 AM
To: struts-user@jakarta.apache.org
Subject: Re: struts and excel


Could you show me what is wrong in the following code?
-----------------------------------------
<%
response.setContentType("application/vnd.ms-excel");
%>
<html>
<head><title>Excel-Export</title></head>
<body>
<table>
<tr>
<td>1997</td>
<td>2000</td>
<td>1999</td>
</tr>
<tr>
<td>12.3</td>
<td>13.4</td>
<td>15.6</td>
</tr>
</table>
</body>
</html>
--------------------------------------------------
This displays the file as HTML page instead of opening an excel file.


>From: "Roy Truelove" <roy@ietfwatch.net>
>Reply-To: "Struts Users Mailing List" <struts-user@jakarta.apache.org>
>To: "Struts Users Mailing List" <struts-user@jakarta.apache.org>
>Subject: Re: struts and excel
>Date: Thu, 6 Jun 2002 11:37:04 -0400
>
>Struts has nothing builtin for this (as far as I know).  Excel can read
>HTML
>tables however, so if your JSP's create a standard <TABLE>, and you set
>your
>content type :
>
>response.setContentType("application/vnd.ms-excel");
>
>the browser should know to open it with Excel.
>
>Take it easy,
>Roy
>
>----- Original Message -----
>From: "yanming lu" <lu_yanming@hotmail.com>
>To: <struts-user@jakarta.apache.org>
>Sent: Thursday, June 06, 2002 11:00 AM
>Subject: struts and excel
>
>
> > How to display an excel file in struts?
> >
> > _________________________________________________________________
> > MSN Photos is the easiest way to share and print your photos:
> > http://photos.msn.com/support/worldwide.aspx
> >
> >
> > --
> > To unsubscribe, e-mail:
><mailto:struts-user-unsubscribe@jakarta.apache.org>
> > For additional commands, e-mail:
><mailto:struts-user-help@jakarta.apache.org>
>
>
>--
>To unsubscribe, e-mail:
><mailto:struts-user-unsubscribe@jakarta.apache.org>
>For additional commands, e-mail:
><mailto:struts-user-help@jakarta.apache.org>
>


_________________________________________________________________
MSN Photos is the easiest way to share and print your photos:
http://photos.msn.com/support/worldwide.aspx


--
To unsubscribe, e-mail:
<mailto:struts-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail:
<mailto:struts-user-help@jakarta.apache.org>




--
To unsubscribe, e-mail:   <mailto:struts-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:struts-user-help@jakarta.apache.org>


Mime
View raw message