Here comes my unhelpful response for the day...

[EMAIL PROTECTED] wrote:

I've got the thing to work returning null as my forward.  That leaves a couple 
of questions though.

1) Does struts write anything to the response before calling you action class?

I don't think so.

2) Does calling flush() on the response output stream cause the response to be 
sent? I kind of think it doesn't, but what exactly does flush() do in this 
instance.

I don't think so.

AND 3) Does struts close the response output stream for me?

I don't think so.

:)

On the first point, I very much doubt it... some headers may get set, but I don't think anything gets written outside your Action.

On the second point, I looked at some code I wrote that does this and some of it calls flush(), some of it doesn't, and both seem to work. I think it's probably a better idea to call it yourself to be safe, but it doesn't seem to matter.

On the first point, I'm almost certain Struts wouldn't do that, but your container certainly may (and perhaps correctly should).

Frank




 --- On Mon 01/23, Frank W. Zammetti < [EMAIL PROTECTED] > wrote:
From: Frank W. Zammetti [mailto: [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
     Cc: user@struts.apache.org
Date: Mon, 23 Jan 2006 14:00:15 -0500 (EST)
Subject: Re: returning a non-html file as response

Hi,If you are writing the response from an Action (which yes, you can do asyou describe), you should return null from execute(). This indicates toStruts that you have taken responsibility for rendering the response andno forward should take place, the response should simply be returned as itexists at that point.-- Frank W. ZammettiFounder and Chief Software ArchitectOmnytex Technologieshttp://www.omnytex.comAIM: fzammettiYahoo: fzammettiMSN: [EMAIL PROTECTED] Mon, January 23, 2006 1:55 pm, [EMAIL PROTECTED] 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: [EMAIL PROTECTED]> For additional commands, e-mail: [EMAIL PROTECTED]>>

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



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]





--
Frank W. Zammetti
Founder and Chief Software Architect
Omnytex Technologies
http://www.omnytex.com
AIM: fzammetti
Yahoo: fzammetti
MSN: [EMAIL PROTECTED]

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to