Re: Identical requests make my csv component always returns the same content

2008-09-14 Thread Yung-Luen Lan
It solves my problem!
Thank you very much!

Regards,
yllan

On Sun, Sep 14, 2008 at 4:36 PM, Stephane Guyot
<[EMAIL PROTECTED]> wrote:
>
> Ok sorry,
> I'm trying to help you but ...

Please don't say sorry. I'm really grateful for your help. :-)

> If you put , just for test , setPageCacheSize(0) on WOApplication the
> problem disapears ?
> See setPageFragmentCacheSize too.
> Did you have a Session ?
> If yes , overriding one of the methods savePage, savePageInPageCache
> or savePageInPageFragmentCache
> to prevent to put in cache some of your pages based on their name may be
> what you are looking for ?
> You can still rely on your own API on each component , like mayBeCached
> defaulting to true, and then overriding on per page basis when you don't
> want caching.
> If you have no session, url of your page may be cache by the browser, then i
> would try to add dummy value in a query string.
> HTH one more time,
> Stephane
> Le 14 sept. 08 à 09:55, Yung-Luen Lan a écrit :
>
> On Sun, Sep 14, 2008 at 3:01 PM, Stephane Guyot
> <[EMAIL PROTECTED]> wrote:
>
> Hi Yung-Luen,
> have a look on the following method : disableClientCaching ---> Class
> WOResponse
> http://developer.apple.com/documentation/DeveloperTools/Reference/WO541Reference/com/webobjects/appserver/WOResponse.html#disableClientCaching()
> You can override appendToResponse in your CSVReport page and invoke
> disableClientCaching,
> something like :
> public void appendToResponse(WOResponse aResponse, WOContext aContext) {
> aResponse.setHeader("application/vnd.ms-excel", "Content-Type");
> super.appendToResponse(aResponse, aContext);
> aResponse.disableClientCaching();
> }
>
> Yes, I've already add this line to my class. However, my problem is
> not a "client side caching" but a "server side caching" I believed.
> There is a method that disable the server side caching on
> WOApplication, but I hope there is some way to set it on specific
> components.
> Regards,
> yllan
>
>
 ___
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list  (Webobjects-dev@lists.apple.com)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]


Re: Identical requests make my csv component always returns the same content

2008-09-14 Thread Stephane Guyot


Ok sorry,
I'm trying to help you but ...

If you put , just for test , setPageCacheSize(0) on WOApplication the  
problem disapears ?

See setPageFragmentCacheSize too.

Did you have a Session ?

If yes , overriding one of the methods savePage, savePageInPageCache  
or savePageInPageFragmentCache
to prevent to put in cache some of your pages based on their name may  
be what you are looking for ?
You can still rely on your own API on each component , like  
mayBeCached defaulting to true, and then overriding on per page basis  
when you don't want caching.


If you have no session, url of your page may be cache by the browser,  
then i would try to add dummy value in a query string.


HTH one more time,
Stephane

Le 14 sept. 08 à 09:55, Yung-Luen Lan a écrit :



On Sun, Sep 14, 2008 at 3:01 PM, Stephane Guyot
<[EMAIL PROTECTED]> wrote:


Hi Yung-Luen,
have a look on the following method : disableClientCaching ---> Class
WOResponse
http://developer.apple.com/documentation/DeveloperTools/Reference/ 
WO541Reference/com/webobjects/appserver/ 
WOResponse.html#disableClientCaching()

You can override appendToResponse in your CSVReport page and invoke
disableClientCaching,
something like :

public void appendToResponse(WOResponse aResponse, WOContext  
aContext) {
aResponse.setHeader("application/vnd.ms-excel", "Content- 
Type");

super.appendToResponse(aResponse, aContext);
aResponse.disableClientCaching();
}



Yes, I've already add this line to my class. However, my problem is
not a "client side caching" but a "server side caching" I believed.

There is a method that disable the server side caching on
WOApplication, but I hope there is some way to set it on specific
components.

Regards,
yllan



 ___
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list  (Webobjects-dev@lists.apple.com)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]

Re: Identical requests make my csv component always returns the same content

2008-09-14 Thread Stephane Guyot


Hi Yung-Luen,

	have a look on the following method : disableClientCaching --->  
Class WOResponse
	http://developer.apple.com/documentation/DeveloperTools/Reference/ 
WO541Reference/com/webobjects/appserver/ 
WOResponse.html#disableClientCaching()


	You can override appendToResponse in your CSVReport page and invoke  
disableClientCaching,

something like :

public void appendToResponse(WOResponse aResponse, WOContext  
aContext) {
aResponse.setHeader("application/vnd.ms-excel", "Content- 
Type");

super.appendToResponse(aResponse, aContext);
aResponse.disableClientCaching();
}

About HTTP headers : http://www.w3.org/Protocols/rfc2616/rfc2616- 
sec14.html


	If your trouble still persist , particularly with browser like IE,  
perhaps you could try to add a query string with time and milliseconds,
	on the client-side. But as usual , less you do with JavaScript,  
better you are ...


Did you know Yslow FireFox Add-ons ?
http://developer.yahoo.com/yslow/help/
https://addons.mozilla.org/en-US/firefox/addon/5369

HTH,
Stephane


Le 13 sept. 08 à 21:24, Yung-Luen Lan a écrit :



Hi folks,

I have a page with a list of data entry using ERXDisplayGroup and a
"Download Report" link which returns a csv-formatted detail of
selected entries.

The link bound to an action looked like:

public WOComponent generateReportFile() {
CSVReport n = pageWithName(CSVReport.class);
n.setDataEntries(selectedEntriesArray());
return n;
}

When user clicked a data entry in the list, I'll toggle it in
selectedEntriesArray using Ajax framework in Wonder.

When the first time user selects some entries and download the report
file, it's fine.

However, no matter how the user modify the selection set after the
first download, they can only get files with the same content as the
first downloaded one.

After investigate this problem, I find that the generateReportFile()
action were called only once at the first click of my link. Seems that
WO cached the component and return it without invoke my action because
those requests are identical. (I use Ajax so there's no whole page
refresh, I guess this is the reason why I change the selection set but
still got identical requests.)

Is there any way to avoid WO cache my component without invoke my  
action?


Regards,
yllan
 ___
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list  (Webobjects-dev@lists.apple.com)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/ 
stephane.guyot11%40wanadoo.fr


This email sent to [EMAIL PROTECTED]



 ___
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list  (Webobjects-dev@lists.apple.com)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]

Re: Identical requests make my csv component always returns the same content

2008-09-14 Thread Yung-Luen Lan
On Sun, Sep 14, 2008 at 3:01 PM, Stephane Guyot
<[EMAIL PROTECTED]> wrote:
>
> Hi Yung-Luen,
> have a look on the following method : disableClientCaching ---> Class
> WOResponse
> http://developer.apple.com/documentation/DeveloperTools/Reference/WO541Reference/com/webobjects/appserver/WOResponse.html#disableClientCaching()
> You can override appendToResponse in your CSVReport page and invoke
> disableClientCaching,
> something like :
>
> public void appendToResponse(WOResponse aResponse, WOContext aContext) {
> aResponse.setHeader("application/vnd.ms-excel", "Content-Type");
> super.appendToResponse(aResponse, aContext);
> aResponse.disableClientCaching();
> }
>

Yes, I've already add this line to my class. However, my problem is
not a "client side caching" but a "server side caching" I believed.

There is a method that disable the server side caching on
WOApplication, but I hope there is some way to set it on specific
components.

Regards,
yllan
 ___
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list  (Webobjects-dev@lists.apple.com)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]