but how do i return a binary stream, that generated at render phase.
2008/3/17, Josh Canfield <[EMAIL PROTECTED]>: > > You need to return a StreamResponse > > > http://tapestry.apache.org/tapestry5/apidocs/org/apache/tapestry/StreamResponse.html > > Also, check out the following for an example. > > http://wiki.apache.org/tapestry/Tapestry5HowToStreamAnExistingBinaryFile > Josh > > > On Sat, Mar 15, 2008 at 8:11 AM, Dmitry Shyshkin <[EMAIL PROTECTED]> > wrote: > > Hello, all > > > > I want to generate image by tapestry page. Follow code successfully set > > Content-Type and output image data, but after that exception is thrown > : > > java.lang.RuntimeException: Page resource/Image did not generate any > > markup when rendered. This could be because its template file could not > > be located, or because a render phase method in the page prevented > > rendering. > > > > Is there is a way to tell tapestry that page output is binary and > > ResposeWriter won't be used for generation? I've thought about > > StreamResponse but it accepted only from action events, not from render > > phase events. > > > > @Inject > > private Response _response; > > > > @BeginRender > > void render() throws IOException { > > Image image = ...; > > IOUtil.transfer(image.getImage().getBinaryStream(), > > _response.getOutputStream(image.getContentType())); > > } > > > > > > Thanks, > > Dmitry > > > > > > --------------------------------------------------------------------- > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > For additional commands, e-mail: [EMAIL PROTECTED] > > > > > > > > > -- > > -- > TheDailyTube.com. Sign up and get the best new videos on the internet > delivered fresh to your inbox. > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > -- with regards Sven Homburg http://tapestry5-components.googlecode.com