Another possibility is with and external page.
However I think that implement a service is a better way.

Here my ExternalPage code that I use for images and other files...

-------------
public class BinaryOutput extends BasePage implements IExternalPage {
         private Long _persistentId;
         private String _mapKey;
         private SerializableUploadFile _file;
         private OutputStream _out;

         public IMarkupWriter getResponseWriter(OutputStream out)
         {
            _out = out;
                return new MimeWriter(_file.getContentType(), 
getOutputEncoding(), out);
         }

         public void activateExternalPage(Object[] parameters, IRequestCycle
cycle) {
                _persistentId = (Long) parameters[0];
                _mapKey = (String) parameters[1];


                PersistentPage page =
PersistentPageService.search(_persistentId.longValue());
                _file = (SerializableUploadFile) page.getObjects().get(_mapKey);

         }


         public void renderPage(IMarkupWriter writer, IRequestCycle cycle) {
                try
                {
                        _out.write(_file.getContent());
                        _out.flush();
                        _out.close();
                } catch (Exception e) {
                        throw new ApplicationRuntimeException(e);
                }
         }

}





> Is there any possibility I could show an image coming from an
> InputStream using Tapestry?
>
> The server needs to access Graphviz ( http://www.graphiz.org ) using JNI
> to create image files from a graph description. The output image from
> Graphviz is saved as a file (can't use a fixed file name, can be 1 - n
> files, etc.) on the HD. Afterwards this images must then be shown in the
> web page.
>
> Can anybody give me a hint on a) how to show images in a web page using
> an InputStream (from the file on the HD) or b) an alternative way to
> show these images?
>
>
>
> kind regards,
> Ruben
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to