You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Tyler Southwick <no...@gmail.com> on 2005/06/26 23:36:39 UTC

changing mime type of a componenet

I need to be able to display binary data from a database as an image
and i'm not sure the best way to do this.  i've been trying to figure
out how to change the mime type of a component and then have the
component just write out the image data.  I can see how to change the
mime type of a page, but not a component.  Is this even possible?  I'm
pretty new to tapestry and thanks for all the help!

-- 
The pile is the hole's natual enemy

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


Re: changing mime type of a componenet

Posted by Andreas Andreou <an...@di.uoa.gr>.
Tyler Southwick wrote:

>I need to be able to display binary data from a database as an image
>and i'm not sure the best way to do this.  i've been trying to figure
>out how to change the mime type of a component and then have the
>component just write out the image data.  I can see how to change the
>mime type of a page, but not a component.  Is this even possible?
>
I don't think that a component can change the mime time...
It's generally cleaner to create a custom service that accepts parameters,
generates the (binary) content and returns it.
Just extend from AbstractService,
override service(IEngineServiceView engine,
IRequestCycle cycle, ResponseOutputStream output)
and write the data to the output object. Then you can use ServiceLinks
to link to the data.

>  I'm
>pretty new to tapestry and thanks for all the help!
>
>  
>


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