Hello,
reading the docs of ByteArrayResource I do not think it is dynamic.
The generated resource is in memory.
greetings
Ricky-22 wrote:
>
> Hi,
>
> I want to be able to generate the byteArray (for MS - Excel report being
> passed to a byteArrayResource every time the resource link is clicked. I
> was
> trying to use getCacheDuration( ) for the same to allow for it to create
> ByteArray every time the resource link is clicked on the page.
>
> I have something like :
>
> final ByteArrayResource modelReportByteArrayResource = new
> ByteArrayResource(CONTENT_TYPE, createByteArray() ,FILE_NAME) {
>
> // java docs removed for clarity
> protected final int getCacheDuration() {
> return -1; // -1 or 0 doesn't work. =(
> }
> };
>
> // add the resource.
> add(new ResourceLink(modelReportResource ));
>
> I tried to override :
> // java docs removed for clarity
> protected final void setHeaders(final WebResponse response) {
> response.setHeader("Cache-Control", "no-cache,
> must-revalidate");
> }
>
> But I still get the same excel report over and over no matter how many
> times
> i click the link, despite me changing some data or the stream.
>
> Any suggestions / thoughts???
>
> Regards
> Vyas, Anirudh
>
>
--
View this message in context:
http://www.nabble.com/ByteArrayResource%27s-getCacheDuration%28-%29-tp18406048p18431593.html
Sent from the Wicket - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]