You can simply set response content-type by yourself, and output
all binary data using OutputStream object attached to
HttpServletResponse.
However you have to retrieve PrintWriter object from RunData first, to
prevent displaying
all template-generated stuff by Turbine:

// Whatever content-type you need
data.getResponse().setContentType("image/jpeg");
// Bogus, used only to fool Turbine.
data.getOut();
// Here's real output stream to write to
ServletOutputStream out = data.getResponse().getOutputStream();

>From now on you can use "out" object to send arbitrary binary data to
client (browser :). Don't forget to close it :)

Scooter.

Steve Ruby wrote:
> 
> I have an application that is made up of screens that
> extend ClientFilesSiteScreen (ClientFilesSiteScreen) extends
> WebMacroSiteSecureScreen.
> 
> On a given screen I made need alternatively write binary data
> out to the user.. Is there a way (proper way) to opt out
> of processing the template in doBuildTemplate(data,context)
> and write binary directly to the client, changing the
> ContentType and and everything.  Obviously I need to have
> it skip looking for a template, or processing the layout
> at all.
> 
> I've got an exisitng servlet (not turbine) that reads
> the appropriate data and writes it out, it does everything
> I need but it doesn't fit into the turbine security model.
> 
> ------------------------------------------------------------
> To subscribe:        [EMAIL PROTECTED]
> To unsubscribe:      [EMAIL PROTECTED]
> Search: <http://www.mail-archive.com/turbine%40list.working-dogs.com/>
> Problems?:           [EMAIL PROTECTED]


------------------------------------------------------------
To subscribe:        [EMAIL PROTECTED]
To unsubscribe:      [EMAIL PROTECTED]
Search: <http://www.mail-archive.com/turbine%40list.working-dogs.com/>
Problems?:           [EMAIL PROTECTED]

Reply via email to