You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Vishal Dalal <vi...@ideacellular.com> on 2005/11/18 08:20:54 UTC

RE: Action.execute() only being invoked the first time a url is requested ??!!!

Hi, 
sorry for intervening. Actually my query is realted to the Caching part...
Actually i wanted to ask, do placing all these paramteres actually guarantee
that the page will be cached, because i think not.

I myself have tried writing all this code in the page. Then when you go
forward from this page and click back, then the same content is displayed as
was done before...
This clearly implies that the brower caches the page and displays that when
you click back...

Please point out in case i am going wrong or if my logic is incorrect..

Thanks for reading

-Vishal

-----Original Message-----
From: atta-ur rehman [mailto:attaurrehman@gmail.com]
Sent: Friday, November 18, 2005 12:39 PM
To: Struts Users Mailing List
Subject: Re: Action.execute() only being invoked the first time a url is
requested ??!!!


Hi,

Most probably your page is gettnig cached by the browser. try

<head>
<META content=0 http-equiv=expires>
<META content=no-cache http-equiv=Pragma>
<META content=no-cache http-equiv=Cache-Control>
<META content=no-store http-equiv=Cache-Control>
</head>

or

<%
response.setHeader("pragma", "no-cache");
response.setHeader("Cache-Control", "no-cache");
response.setHeader("Cache-Control", "no-store");
response.setDateHeader("Expires", 0);
%>

to keep your browser from caching the page and see if it works.

HTH.

ATTA

On 11/17/05, Mon Cab <fu...@yahoo.com> wrote:
>
>
> For Example if I type in my browser address bar:
>
> http://127.0.0.1:8080/webapp/userSignup.do?action=whatever
>
> The first time, I type this in, this invokes the
> execute method of my Action class (I'm using
> System.out ("Action execute Invoked") in Action
> execute to test this). If I then enter the exact same
> url, this method is not getting called.
>
> I am not using validator at all!!
>
> Can anyone explain what is going on with this?
>
>
>
>
> __________________________________
> Yahoo! FareChase: Search multiple travel sites in one click.
> http://farechase.yahoo.com
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>

Make your callers hear anything you like.Call 456 say DIALER TONES.

An idea can change your life. 

************** LEGAL DISCLAIMER ************
This E-Mail may contain Confidential and/or legally privileged Information and is meant for the intended recipient(s) only. If you have received this e-mail in error and are not the intended recipient/s, kindly notify us at mailadmin@ideacellular.com and then delete this e-mail immediately from your system. You are also hereby notified that any use, any form of reproduction, dissemination, copying, disclosure, modification, distribution and/or publication of this e-mail, its contents or its attachment/s other than by its intended recipient/s is strictly prohibited and may be unlawful.

Internet Communications cannot be guaranteed to be secure or error-free as information could be delayed, intercepted, corrupted, lost, or contain viruses. IDEA Cellular Limited does not accept any liability for any errors, omissions, viruses or computer problems experienced by any recipient as a result of this e-mail.

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: Action.execute() only being invoked the first time a url is requested ??!!!

Posted by Mon Cab <fu...@yahoo.com>.
Thanks Wendy

Alas, I ended up uninstalling Ethereal, a while ago,
due to system issues.  


--- Laurie Harper <la...@holoweb.net> wrote:

> Do you get that behaviour *with* the cache control
> stuff in place or 
> without it? If without, have you checked the
> response (say with 
> Ethereal) to see if there are Expires or other
> caching-related headers 
> being included by something else?
> 
> L.
> 
> Mon Cab wrote:
> > It's understandable that my browser would retireve
> > from cache when I hit the back button.  BUT:
> Should my
> > browser also be retrieving from cache when I click
> on
> > the same url twice, even if the url/uri is a get
> > request. 
> > 
> > I am implementing a logout link as follows:
> > login.do?use_case=logout
> > 
> > When I click on this link twice my
> Action.execute() is
> > not being invoked.  According to the HTTP
> > Specification (section 13.9 -
> >
>
http://www.w3.org/Protocols/rfc2616/rfc2616-sec13.html#sec13):
> > 
> > since some applications have traditionally used
> GETs
> > and HEADs with query URLs (those containing a "?"
> in
> > the rel_path part) to perform operations with
> > significant side effects, caches MUST NOT treat
> > responses to such URIs as fresh unless the server
> > provides an explicit expiration time. This
> > specifically means that responses from HTTP/1.0
> > servers for such URIs SHOULD NOT be taken from a
> > cache. See section 9.1.1 for related information. 
> > 
> > 
> > 
> > 
> > --- Michael Jouravlev <jm...@gmail.com> wrote:
> > 
> > 
> >> Browser is not obliged to reload non-cached page
> >> when a user navigates
> >> back in browser page history. Quite the opposite,
> >> they must present
> >> the resourse in the same state it was accessed
> for
> >> the first time.
> >> Opera does not reload a page, even with
> >> cache-control settings telling
> >> to not cache a page. MSIE reloads page when it
> sees
> >> "no-cache".
> >> Firefox reloads a page when it sees "no-store" or
> >> the page is secured
> >> by SSL and returned as "no-cache".
> >>
> >> Usually "no-cache, no-store" is enough for most
> >> browsers, but not for Opera.
> >>
> >> Michael.
> >>
> >>
> >
>
---------------------------------------------------------------------
> >> To unsubscribe, e-mail:
> >> user-unsubscribe@struts.apache.org
> >> For additional commands, e-mail:
> >> user-help@struts.apache.org
> >>
> >>
> > 
> > 
> > 
> > 		
> > __________________________________ 
> > Start your day with Yahoo! - Make it your home
> page! 
> > http://www.yahoo.com/r/hs
> 
> 
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> user-unsubscribe@struts.apache.org
> For additional commands, e-mail:
> user-help@struts.apache.org
> 
> 



		
__________________________________ 
Start your day with Yahoo! - Make it your home page! 
http://www.yahoo.com/r/hs

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: Action.execute() only being invoked the first time a url is requested ??!!!

Posted by Laurie Harper <la...@holoweb.net>.
Do you get that behaviour *with* the cache control stuff in place or 
without it? If without, have you checked the response (say with 
Ethereal) to see if there are Expires or other caching-related headers 
being included by something else?

L.

Mon Cab wrote:
> It's understandable that my browser would retireve
> from cache when I hit the back button.  BUT: Should my
> browser also be retrieving from cache when I click on
> the same url twice, even if the url/uri is a get
> request. 
> 
> I am implementing a logout link as follows:
> login.do?use_case=logout
> 
> When I click on this link twice my Action.execute() is
> not being invoked.  According to the HTTP
> Specification (section 13.9 -
> http://www.w3.org/Protocols/rfc2616/rfc2616-sec13.html#sec13):
> 
> since some applications have traditionally used GETs
> and HEADs with query URLs (those containing a "?" in
> the rel_path part) to perform operations with
> significant side effects, caches MUST NOT treat
> responses to such URIs as fresh unless the server
> provides an explicit expiration time. This
> specifically means that responses from HTTP/1.0
> servers for such URIs SHOULD NOT be taken from a
> cache. See section 9.1.1 for related information. 
> 
> 
> 
> 
> --- Michael Jouravlev <jm...@gmail.com> wrote:
> 
> 
>> Browser is not obliged to reload non-cached page
>> when a user navigates
>> back in browser page history. Quite the opposite,
>> they must present
>> the resourse in the same state it was accessed for
>> the first time.
>> Opera does not reload a page, even with
>> cache-control settings telling
>> to not cache a page. MSIE reloads page when it sees
>> "no-cache".
>> Firefox reloads a page when it sees "no-store" or
>> the page is secured
>> by SSL and returned as "no-cache".
>>
>> Usually "no-cache, no-store" is enough for most
>> browsers, but not for Opera.
>>
>> Michael.
>>
>>
> ---------------------------------------------------------------------
>> To unsubscribe, e-mail:
>> user-unsubscribe@struts.apache.org
>> For additional commands, e-mail:
>> user-help@struts.apache.org
>>
>>
> 
> 
> 
> 		
> __________________________________ 
> Start your day with Yahoo! - Make it your home page! 
> http://www.yahoo.com/r/hs


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: Action.execute() only being invoked the first time a url is requested ??!!!

Posted by Mon Cab <fu...@yahoo.com>.
Got it.  Thanks Michael.

--- Michael Jouravlev <jm...@gmail.com> wrote:

> On 11/25/05, Mon Cab <fu...@yahoo.com> wrote:
> > It's understandable that my browser would retireve
> > from cache when I hit the back button.  BUT:
> Should my
> > browser also be retrieving from cache when I click
> on
> > the same url twice, even if the url/uri is a get
> > request.
> 
> Yes, it might do so if page is cacheable. It must
> reload page from the
> server if you reload it explicitly with "Reload"
> button.
> 
> > I am implementing a logout link as follows:
> > login.do?use_case=logout
> >
> > When I click on this link twice my
> Action.execute() is
> > not being invoked.  According to the HTTP
> > Specification (section 13.9 -
> >
>
http://www.w3.org/Protocols/rfc2616/rfc2616-sec13.html#sec13):
> >
> > since some applications have traditionally used
> GETs
> > and HEADs with query URLs (those containing a "?"
> in
> > the rel_path part) to perform operations with
> > significant side effects, caches MUST NOT treat
> > responses to such URIs as fresh unless the server
> > provides an explicit expiration time.
> 
> Is it server's or browser's problem that "some
> applications have
> traditionally used" HTTP protocol not the way it was
> intended to do?
> GET requests are meant to produce no side effects.
> To be on the safe
> side, just return the proper cache-control headers.
> On Firefox, the
> headers are easy to spot with Live HTTPHeaders
> extension.
> 
> Michael.
> 
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> user-unsubscribe@struts.apache.org
> For additional commands, e-mail:
> user-help@struts.apache.org
> 
> 



		
__________________________________ 
Start your day with Yahoo! - Make it your home page! 
http://www.yahoo.com/r/hs

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: Action.execute() only being invoked the first time a url is requested ??!!!

Posted by Michael Jouravlev <jm...@gmail.com>.
On 11/25/05, Mon Cab <fu...@yahoo.com> wrote:
> It's understandable that my browser would retireve
> from cache when I hit the back button.  BUT: Should my
> browser also be retrieving from cache when I click on
> the same url twice, even if the url/uri is a get
> request.

Yes, it might do so if page is cacheable. It must reload page from the
server if you reload it explicitly with "Reload" button.

> I am implementing a logout link as follows:
> login.do?use_case=logout
>
> When I click on this link twice my Action.execute() is
> not being invoked.  According to the HTTP
> Specification (section 13.9 -
> http://www.w3.org/Protocols/rfc2616/rfc2616-sec13.html#sec13):
>
> since some applications have traditionally used GETs
> and HEADs with query URLs (those containing a "?" in
> the rel_path part) to perform operations with
> significant side effects, caches MUST NOT treat
> responses to such URIs as fresh unless the server
> provides an explicit expiration time.

Is it server's or browser's problem that "some applications have
traditionally used" HTTP protocol not the way it was intended to do?
GET requests are meant to produce no side effects. To be on the safe
side, just return the proper cache-control headers. On Firefox, the
headers are easy to spot with Live HTTPHeaders extension.

Michael.

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: Action.execute() only being invoked the first time a url is requested ??!!!

Posted by Laurie Harper <la...@holoweb.net>.
Michael Jouravlev wrote:
> On 11/19/05, Laurie Harper <la...@holoweb.net> wrote:
> 
>>>This clearly implies that the brower caches the page and displays that when
>>>you click back...
>>
>>All that implies is that the dynamic content hasn't changed. Unless the
>>page has data on it that you know should be different on every page load.
> 
> 
> Browser is not obliged to reload non-cached page when a user navigates
> back in browser page history. Quite the opposite, they must present
> the resourse in the same state it was accessed for the first time.
> Opera does not reload a page, even with cache-control settings telling
> to not cache a page. MSIE reloads page when it sees "no-cache".
> Firefox reloads a page when it sees "no-store" or the page is secured
> by SSL and returned as "no-cache".
> 
> Usually "no-cache, no-store" is enough for most browsers, but not for Opera.

That's a useful overview, thanks Michael! I don't suppose you happen to 
know a solution that doesn't break IE for file downloads do you? (If 
you're not familiar with the problem, it effects downloads for file 
types IE is configured to open automatically, such as Office documents; 
with caching disabled IE will delete the file, as it should, but it 
deletes it before trying to *open* it, so no application opens and you 
get no file on disk...)

L.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: Action.execute() only being invoked the first time a url is requested ??!!!

Posted by Mon Cab <fu...@yahoo.com>.
It's understandable that my browser would retireve
from cache when I hit the back button.  BUT: Should my
browser also be retrieving from cache when I click on
the same url twice, even if the url/uri is a get
request. 

I am implementing a logout link as follows:
login.do?use_case=logout

When I click on this link twice my Action.execute() is
not being invoked.  According to the HTTP
Specification (section 13.9 -
http://www.w3.org/Protocols/rfc2616/rfc2616-sec13.html#sec13):

since some applications have traditionally used GETs
and HEADs with query URLs (those containing a "?" in
the rel_path part) to perform operations with
significant side effects, caches MUST NOT treat
responses to such URIs as fresh unless the server
provides an explicit expiration time. This
specifically means that responses from HTTP/1.0
servers for such URIs SHOULD NOT be taken from a
cache. See section 9.1.1 for related information. 




--- Michael Jouravlev <jm...@gmail.com> wrote:


> Browser is not obliged to reload non-cached page
> when a user navigates
> back in browser page history. Quite the opposite,
> they must present
> the resourse in the same state it was accessed for
> the first time.
> Opera does not reload a page, even with
> cache-control settings telling
> to not cache a page. MSIE reloads page when it sees
> "no-cache".
> Firefox reloads a page when it sees "no-store" or
> the page is secured
> by SSL and returned as "no-cache".
> 
> Usually "no-cache, no-store" is enough for most
> browsers, but not for Opera.
> 
> Michael.
> 
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> user-unsubscribe@struts.apache.org
> For additional commands, e-mail:
> user-help@struts.apache.org
> 
> 



		
__________________________________ 
Start your day with Yahoo! - Make it your home page! 
http://www.yahoo.com/r/hs

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: Action.execute() only being invoked the first time a url is requested ??!!!

Posted by Michael Jouravlev <jm...@gmail.com>.
On 11/19/05, Laurie Harper <la...@holoweb.net> wrote:
> > This clearly implies that the brower caches the page and displays that when
> > you click back...
>
> All that implies is that the dynamic content hasn't changed. Unless the
> page has data on it that you know should be different on every page load.

Browser is not obliged to reload non-cached page when a user navigates
back in browser page history. Quite the opposite, they must present
the resourse in the same state it was accessed for the first time.
Opera does not reload a page, even with cache-control settings telling
to not cache a page. MSIE reloads page when it sees "no-cache".
Firefox reloads a page when it sees "no-store" or the page is secured
by SSL and returned as "no-cache".

Usually "no-cache, no-store" is enough for most browsers, but not for Opera.

Michael.

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: Action.execute() only being invoked the first time a url is requested ??!!!

Posted by Laurie Harper <la...@holoweb.net>.
Vishal Dalal wrote:
> Hi, 
> sorry for intervening. Actually my query is realted to the Caching part...
> Actually i wanted to ask, do placing all these paramteres actually guarantee
> that the page will be cached, because i think not.

Browsers aren't terribly consistent about how they interpret the various 
caching-related headers, but that should work. You can also tell Struts 
to do this for you by configuring the controller in struts-config.xml to 
avoid having to add all that code to every JSP.

> I myself have tried writing all this code in the page. Then when you go
> forward from this page and click back, then the same content is displayed as
> was done before...
> This clearly implies that the brower caches the page and displays that when
> you click back...

All that implies is that the dynamic content hasn't changed. Unless the 
page has data on it that you know should be different on every page load.

L.

> 
> Please point out in case i am going wrong or if my logic is incorrect..
> 
> Thanks for reading
> 
> -Vishal
> 
> -----Original Message-----
> From: atta-ur rehman [mailto:attaurrehman@gmail.com]
> Sent: Friday, November 18, 2005 12:39 PM
> To: Struts Users Mailing List
> Subject: Re: Action.execute() only being invoked the first time a url is
> requested ??!!!
> 
> 
> Hi,
> 
> Most probably your page is gettnig cached by the browser. try
> 
> <head>
> <META content=0 http-equiv=expires>
> <META content=no-cache http-equiv=Pragma>
> <META content=no-cache http-equiv=Cache-Control>
> <META content=no-store http-equiv=Cache-Control>
> </head>
> 
> or
> 
> <%
> response.setHeader("pragma", "no-cache");
> response.setHeader("Cache-Control", "no-cache");
> response.setHeader("Cache-Control", "no-store");
> response.setDateHeader("Expires", 0);
> %>
> 
> to keep your browser from caching the page and see if it works.
> 
> HTH.
> 
> ATTA
> 
> On 11/17/05, Mon Cab <fu...@yahoo.com> wrote:
> 
>>
>>For Example if I type in my browser address bar:
>>
>>http://127.0.0.1:8080/webapp/userSignup.do?action=whatever
>>
>>The first time, I type this in, this invokes the
>>execute method of my Action class (I'm using
>>System.out ("Action execute Invoked") in Action
>>execute to test this). If I then enter the exact same
>>url, this method is not getting called.
>>
>>I am not using validator at all!!
>>
>>Can anyone explain what is going on with this?
>>
>>
>>
>>
>>__________________________________
>>Yahoo! FareChase: Search multiple travel sites in one click.
>>http://farechase.yahoo.com
>>
>>---------------------------------------------------------------------
>>To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>>For additional commands, e-mail: user-help@struts.apache.org
>>
>>
> 
> 
> Make your callers hear anything you like.Call 456 say DIALER TONES.
> 
> An idea can change your life. 
> 
> ************** LEGAL DISCLAIMER ************
> This E-Mail may contain Confidential and/or legally privileged Information and is meant for the intended recipient(s) only. If you have received this e-mail in error and are not the intended recipient/s, kindly notify us at mailadmin@ideacellular.com and then delete this e-mail immediately from your system. You are also hereby notified that any use, any form of reproduction, dissemination, copying, disclosure, modification, distribution and/or publication of this e-mail, its contents or its attachment/s other than by its intended recipient/s is strictly prohibited and may be unlawful.
> 
> Internet Communications cannot be guaranteed to be secure or error-free as information could be delayed, intercepted, corrupted, lost, or contain viruses. IDEA Cellular Limited does not accept any liability for any errors, omissions, viruses or computer problems experienced by any recipient as a result of this e-mail.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org