struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "El Harouchi, Jaafar [IT]" <jaafar.elharou...@citigroup.com>
Subject RE: How To Render Binary Output - spreadsheet - from Struts
Date Wed, 25 Jun 2003 21:11:47 GMT
And I highly recommend first doing:
	response.reset();
if you are using HTTPS.
-jaafar

-----Original Message-----
From: Hookom, Jacob [mailto:Jacob.Hookom@redline.mckhboc.com]
Sent: Wednesday, June 25, 2003 4:47 PM
To: 'Struts Users Mailing List'
Subject: RE: How To Render Binary Output - spreadsheet - from Struts


Also, you will want to set some headers too:

response.setHeader("Content-Disposition","attachment;filename=\"" + fileName
+ "\"");

This will prompt the person to download the file (basically automates the
save as).  I just finished doing the same thing for a project and we wanted
to remove the confusion about what to save and what the file name was, etc.

-Jacob Hookom

-----Original Message-----
From: Michael Remijan [mailto:Michael.Remijan@solocup.com]
Sent: Wednesday, June 25, 2003 1:59 PM
To: Struts Users Mailing List
Subject: RE: How To Render Binary Output - spreadsheet - from Struts

Make a servlet call, then set the response content type as

response.setContentType("application/vnd.ms-excel");

and then write the contents of the excel spreedsheet the the reponse output
stream.  If you have a hyperlink on a jsp page that has an href like this:

  http://localhost/context/do-export-mapping

then by setting the content type above will cause excel to open
automatically.

Mike

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

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

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


Mime
View raw message