wicket-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Martin Grigorov <mgrigo...@apache.org>
Subject Re: Input Stream DownloadLink
Date Wed, 06 Jan 2016 07:45:25 GMT

Thanks for sharing your component with us!

In the "about" section you use LoadableDetachableModel that returns
InputStream. For single use this would work fine, but if you try to use
this model second time in the same request then it may fail depending on
the type of the InputStream because you may need to reset it. I cannot
imagine now a use case where you will need to use it second time in the
same request but I also see no reason to use LDM. Using
AbstractReadOnlyModel looks better to me.

Apart from that I think you can use "new ResourceLink(String, IResource)"
for the same kind of tasks. E.g. with ByteArrayResource that either accepts
its byte[] as constructor parameter or loads it dynamically by overriding

Happy New Year!

Martin Grigorov
Wicket Training and Consulting

On Wed, Jan 6, 2016 at 12:16 AM, Martin Spielmann <
martin.spielmann@pingunaut.com> wrote:

> Hello all,
> I just published a small version of a download link which enables you to
> serve
> any data coming from an InputStream for download.
> https://github.com/pingunaut/wicket-stream-download-example
> I used that one in multiple projects now, so I thought it could be
> interesting
> for other people too.
> Just wanted to hear, if there any need for this one out there before
> spending
> more effort for docs and error handling.
> Happy new year!
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message