beehive-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Robert Read" <>
Subject RE: Stream a fiile from an action
Date Thu, 10 May 2007 22:36:03 GMT
Hi Again,

Further to my last email...

the blank JSP provides an empty response 'buffer'.  You can forward to
another page or the same page - but then its buffer will contain the
rendered JSP - so it will require resetting prior to streaming the new

I think this is the required method:


-----Original Message-----
From: Robert Read [] 
Sent: Friday, 11 May 2007 10:21 a.m.
To: Beehive Users
Subject: RE: Stream a fiile from an action

Hi Ben and Carlin

In my experience forwarding to a JSP is necessary to get a hold of a
suitable response, which I guess is the scope issue you mention (though
I'm not 100% sure since I'm unfamiliar with the term 'scoped response').
In Beehive, we forwarded to a blank JSP. The browser grabs the page and
interprets the content-disposition etc opening the appropriate dialog
for the file-type mapping.

This is not on portal but weblogic 9.2 with out-of-the-box Beehive.


Robert Read
ITS Group Applications
The University of Auckland
Telephone: +64 9 373 7599 ext 82475

-----Original Message-----
From: Carlin Rogers [] 
Sent: Friday, 11 May 2007 10:07 a.m.
To: Beehive Users
Subject: Re: Stream a fiile from an action

Hi Ben,

Your example definitely works in a standalone Beehive NetUI
application. You're probably correct about the scoped response but I'm
not yet certain. Have you posted this question to the portal forum?

Kind regards,

On 5/10/07, Burgess, Benjamin <> wrote:
> What is the correct way to stream a file from a Beehive action?
> What I have tried is to use (which doesn't work) is to declare an
> method that doesn't have any forwards:
> getResponse().setContentType("application/zip");
> getResponse().setHeader("Content-Disposition",
> "attachment;");
> getResponse().getOutputStream().write(bytes);
> return null;
> However, the content type header never gets updated; it always comes
> the browser as text/html.  I assume this has something to do with
> Responses.  Also, the actual content being returned to the browser
> starts with the bytes for the zip file, but then has the JSP from
> the request initiated concatenated to the end of it.  Doesn't a null
> forward mean to stop the response right there?
> I am using BEA Weblogic Portal 9.2 with out of the box Beehive.
> Ben
> ******************************************
> This message, including any attachments, contains confidential
information intended for a specific individual and purpose, and is
protected by law.  If you are not the intended recipient, please contact
sender immediately by reply e-mail and destroy all copies.  You are
hereby notified that any disclosure, copying, or distribution of this
message, or the taking of any action based on it, is strictly
> ******************************************

View raw message