struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Witt, Mike (OH35)" <>
Subject RE: Returning raw data from an action
Date Mon, 01 Dec 2003 20:30:59 GMT
When using FOP on a past project to output pdf, I used:

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

The second line caused it the browser to give a open/save dialog so that
.csv does not appear in the browser window.  Also I'm not sure if a content
type other than text/plain is more appropriate for CSV, but it would be
worth looking in to.

Incidentally, when the action is completed, return null so that it does not
forward anywhere.


-----Original Message-----
From: Ben Anderson []
Sent: Monday, December 01, 2003 3:12 PM
Subject: Re: Returning raw data from an action

modified slightly:

    // Now write the actual content type and data
    JspWriter stream = response.getWriter();
    ... write out the csv ...

    // Return null to tell Struts the response is complete
    return (null);


>From: "Jim Kennedy" <>
>Reply-To: "Jim Kennedy" <>
>To: "Struts Users Mailing List" <>
>Subject: Returning raw data from an action
>Date: Mon, 1 Dec 2003 14:49:54 -0500
>I have a need to process a large amount of data and return a csv file to 
>client.  Is it possible to do this with a Struts action?  Is so, what would
>I return as an ActionForward (see below)?
>return mapping.findForward("blabla);
>return mapping.findForward(null);
>I don't want to forward anywhere.  And I'm not returning HTML data either.
>I know, I know should use model 2, but I can't in this case. Too much
>overhead with 50k records.
>To unsubscribe, e-mail:
>For additional commands, e-mail:

Share holiday photos without swamping your Inbox.  Get MSN Extra Storage 

To unsubscribe, e-mail:
For additional commands, e-mail:

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message