Re: Problem: WOActionResult with ObjectOutputStream
Re: Problem: WOActionResult with ObjectOutputStream
- Subject: Re: Problem: WOActionResult with ObjectOutputStream
- From: Chuck Hill <email@hidden>
- Date: Wed, 25 Apr 2007 08:45:13 -0700
If it is a ByteArrayOutputStream stream you can do this:
WOResponse response = context().response();
ByteArrayOutputStream baos = // I don't know where you get
this from...
response.setContentStream(new ByteArrayInputStream
(baos.toByteArray()), 8192, baos.size());
// If this is a download...
String contentDisposition = "attachment; filename=\"" file
name + "\"";
response.setHeader(contentDisposition,
WOApplication.ContentDispositionHeaderKey);
response.setHeader("MIME TYPE GOES HEREl",
WOApplication.ContentTypeHeaderKey);
response.disableClientCaching();
response.removeHeadersForKey("Cache-Control");
response.removeHeadersForKey("pragma");
return response;
If it is not a ByteArrayOutputStream, then Google "Java convert
output stream input stream"
Chuck
On Apr 25, 2007, at 6:56 AM, Frederico Lellis wrote:
I'm trying to have a WOActionResult called from a directAction
return an ObjectOutputSteam but i haven't had much luck , the
serialization is working fine , but i cant seem to send the
object . can anyone give me a hand ?
thanks in advance
--
--
******************************************************
Frederico L. Albuquerque
\o/
| Moleque de Idéias Educação e Tecnologia Ltda
/ \
e-mail: email@hidden
email@hidden
******************************************************
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
40global-village.net
This email sent to email@hidden
--
Practical WebObjects - for developers who want to increase their
overall knowledge of WebObjects or who are trying to solve specific
problems.
http://www.global-village.net/products/practical_webobjects
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden