Re: ByteArrayResource's getCacheDuration( )

2008-07-15 Thread Ricky
Hi,

My apologies I did not follow up on this. I

On Sun, Jul 13, 2008 at 1:29 PM, greeklinux [EMAIL PROTECTED] wrote:


 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]




-- 

Regards
Vyas, Anirudh
|| ॐ ||


Re: ByteArrayResource's getCacheDuration( )

2008-07-15 Thread Ricky
err sorry for half reply, I didnt follow up on this, my apologies. I used a
WebResource and am setting setIsCacheable(false)  and also overriding
getResourceStream method of the same to return a custom IResourceStream
instance.

In IResourceStream i override, the getInputStream method to chain
ByteArrayOutputStream to get my data dynamically. I'll post the code
tommorrow, when i get to office.


Regards
Vyas, Anirudh

On Tue, Jul 15, 2008 at 8:25 PM, Ricky [EMAIL PROTECTED] wrote:

 Hi,

 My apologies I did not follow up on this. I


 On Sun, Jul 13, 2008 at 1:29 PM, greeklinux [EMAIL PROTECTED] wrote:


 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]




 --

 Regards
 Vyas, Anirudh
 || ॐ ||



Re: ByteArrayResource's getCacheDuration( )

2008-07-13 Thread greeklinux

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]



ByteArrayResource's getCacheDuration( )

2008-07-11 Thread Ricky
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