You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by "chadmichael@excite.com" <ch...@excite.com> on 2006/01/23 19:55:38 UTC

returning a non-html file as response

I need to return a differnt kind of resposne type.  Its an excel file if your curious.  I think I understand how to do this with a plain servlet, but I am trying to fit it into the structure of the struts architecture.  Can someone explain to me how to do this?  In particular, can I just grab the response stream from the response object I get in the execute method and start writing to it.  If so, what becomes of the forward I'm supposed to return.  

Feel free to inform me of my misuse of the platform if that's the case.

_______________________________________________
Join Excite! - http://www.excite.com
The most personalized portal on the Web!



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


Re: returning a non-html file as response

Posted by Laurie Harper <la...@holoweb.net>.
chadmichael@excite.com wrote:
> I need to return a differnt kind of resposne type.  Its an excel file if your curious.  I think I understand how to do this with a plain servlet, but I am trying to fit it into the structure of the struts architecture.  Can someone explain to me how to do this?  In particular, can I just grab the response stream from the response object I get in the execute method and start writing to it.  If so, what becomes of the forward I'm supposed to return.  
> 
> Feel free to inform me of my misuse of the platform if that's the case.

You might find this helpful too:

http://wiki.apache.org/struts/StrutsFileDownload

L.


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


Re: returning a non-html file as response

Posted by "Frank W. Zammetti" <fz...@omnytex.com>.
Hi,

If you are writing the response from an Action (which yes, you can do as
you describe), you should return null from execute().  This indicates to
Struts that you have taken responsibility for rendering the response and
no forward should take place, the response should simply be returned as it
exists at that point.

-- 
Frank W. Zammetti
Founder and Chief Software Architect
Omnytex Technologies
http://www.omnytex.com
AIM: fzammetti
Yahoo: fzammetti
MSN: fzammetti@hotmail.com

On Mon, January 23, 2006 1:55 pm, chadmichael@excite.com said:
>
> I need to return a differnt kind of resposne type.  Its an excel file if
> your curious.  I think I understand how to do this with a plain servlet,
> but I am trying to fit it into the structure of the struts architecture.
> Can someone explain to me how to do this?  In particular, can I just grab
> the response stream from the response object I get in the execute method
> and start writing to it.  If so, what becomes of the forward I'm supposed
> to return.
>
> Feel free to inform me of my misuse of the platform if that's the case.
>
> _______________________________________________
> Join Excite! - http://www.excite.com
> The most personalized portal on the Web!
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>


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