So I've embedded an img tag as follows: <img src="image/Get/1"/>

The url "image/Get/1" invokes page "image/Get" with an activation context of
"1". The *.java onActivate handler loads the image from Hibernate. The
corresponding *.tml page only has one component on it of which takes a
@Parameter of type Image ... which the page successfully gives it.

<t:Layout xmlns:t="http://tapestry.apache.org/schema/tapestry_5_0_0.xsd";>
    <t:ImageStream image="value"/>
</t:Layout>

And hopefully, the ImageStream component attempts to render itself --- does
this sound correct so far?

My problem is - how does the component render binary data? IE: component
render methods can take 0 or 1 argument, a MarkupWriter ... which doesn't
have a binary output method. And if I try to be slick and change the render
method signature to

Object beginRender()

I predictably get the error:

"The return value from a render phase event method was not compatible the
expected return type of java.lang.Boolean. You should change the method to
return the correct type."

So I think I'm back to the same question, "is there a way I can return
binary information as part of a page or component's rendering lifecycle?"
i.e.: in response to a GET.

I can definitely do it onAction, onSuccess, etc since those methods can
return Object ... streams, pages, etc. But what about BEFORE the user takes
such action ... in the rendering cycle or as a simple response to a GET.
Those render lifecycle methods seem to return boolean.

Does that question make sense? Thanks,

-Luther




On Tue, Mar 10, 2009 at 5:06 PM, Thiago H. de Paula Figueiredo <
thiag...@gmail.com> wrote:

> Em Tue, 10 Mar 2009 16:57:11 -0300, Luther Baker <lutherba...@gmail.com>
> escreveu:
>
>  Am I'm looking for a render method that returns an Object - and stops the
>> rest of the lifecycle?
>>
>
> I would try to create a component instead. It is a more reusable solution.
>
> --
> Thiago H. de Paula Figueiredo
> Independent Java consultant, developer, and instructor
> http://www.arsmachina.com.br/thiago
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
>
>

Reply via email to