stream = class AbstractResourceStreamWriter()
{
public void write(OutputStream output)
{
 // do youre writing
}
}

  getRequestCycle().setRequestTarget(new
ResourceStreamRequestTarget(stream).setFileName("file.xls"));

johan


On Tue, Apr 1, 2008 at 9:31 AM, <[EMAIL PROTECTED]> wrote:

> Hello:
> I am trying to export dynamically generated excel file.
> The generator would send the file.xls to an OutputStream.
>
> In wicket, I am trying to use example as below but
>  how can I connect the OutputStream to the inputstream
> ins.  Pipedoutputstream would block. Using a separate thread
> is not desirable.
>
> public void onClick() {
>
>   IResourceStream stream = new AbstractResourceStream() {
>
>                         public InputStream getInputStream() throws
> ResourceStreamNotFoundException {
>
>
>                             return ins;
>                         }
>
>                         public void close() throws IOException {
>                             ins.close();
>                         }
>                     };
>
>                     getRequestCycle().setRequestTarget(
>                             new
> ResourceStreamRequestTarget(stream).setFileName("file.xls"));

Reply via email to