You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by dukehoops <ni...@doppelganger.com> on 2008/11/14 21:49:00 UTC
browser back button - shouldn't onBeforeRender() execute?
Hi,
I have two pages A and B:
-user lands on A (browser location says /A)
-user clicks on a form's SubmitLink, onSubmit() says setResponsePage(new
B(state))
--in Firebug, I see POST, followed by GET /B
-user lands on B ( location is /B)
-user clicks browser back button and lands on A without server being hit at
all.
At this point I expected browser to issue GET /A and A's onBeforeRender to
run. is my expectation correct? If not, what is the expected behavior.
The reason for my question, is that I want to prevent user from "back"-ing
to A once on B. So I wanted to use A's onBeforeRender to evaluate state and
redirect someplace else. If my expectation above is incorrect, could someone
suggest a better approach?
thanks
-nikita
I am using Firebug with FF3/Win and Wicket 1.3.5
Here are A's initial response headers:
Server Apache-Coyote/1.1
Cache-Control no-cache, max-age=0, must-revalidate
Pragma no-cache
Content-Type text/html;charset=UTF-8
Content-Language en-US
Content-Length 13209
-----
----------------
Nikita Tovstoles
vside.com
----------------
--
View this message in context: http://www.nabble.com/browser-back-button---shouldn%27t-onBeforeRender%28%29-execute--tp20508047p20508047.html
Sent from the Wicket - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org
Re: browser back button - shouldn't onBeforeRender() execute?
Posted by Timo Rantalaiho <Ti...@ri.fi>.
On Mon, 17 Nov 2008, dukehoops wrote:
> Thanks for your reply. But shouldn't the headers I listed disable caching
> already? Re-pasting below:
Yep, but in the end it's a question of what the browser does.
You could experiment with different browser settings.
Best wishes,
Timo
--
Timo Rantalaiho
Reaktor Innovations Oy <URL: http://www.ri.fi/ >
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org
Re: browser back button - shouldn't onBeforeRender() execute?
Posted by Johan Compagner <jc...@gmail.com>.
no the only realy thing that i know most browser really look it up again is
"no-store"
thats why we have that disabled by default:
protected void setHeaders(WebResponse response)
{
response.setHeader("Pragma", "no-cache");
response.setHeader("Cache-Control", "no-cache, max-age=0,
must-revalidate"); // no-store
}
On Mon, Nov 17, 2008 at 7:02 PM, dukehoops <ni...@doppelganger.com> wrote:
>
> Timo,
>
> Thanks for your reply. But shouldn't the headers I listed disable caching
> already? Re-pasting below:
> Here are A's initial response headers:
> Server Apache-Coyote/1.1
> Cache-Control no-cache, max-age=0, must-revalidate
> Pragma no-cache
> Content-Type text/html;charset=UTF-8
> Content-Language en-US
> Content-Length 13209
>
>
> Timo Rantalaiho wrote:
> >
> > On Fri, 14 Nov 2008, dukehoops wrote:
> >> -user clicks browser back button and lands on A without server being hit
> >> at
> >> all.
> >>
> >> At this point I expected browser to issue GET /A and A's onBeforeRender
> >> to
> >> run. is my expectation correct? If not, what is the expected behavior.
> >>
> >> The reason for my question, is that I want to prevent user from
> >> "back"-ing
> >> to A once on B. So I wanted to use A's onBeforeRender to evaluate state
> >> and
> >> redirect someplace else. If my expectation above is incorrect, could
> >> someone
> >> suggest a better approach?
> >
> > That behaviour depends on the browser caching behaviour.
> > Some brosers on some settings get page A from their cache,
> > in which case the server is not being hit.
> >
> > You might get it to work by adding non-caching HTTP headers
> > on page A.
> >
> > Best wishes,
> > Timo
> >
> > --
> > Timo Rantalaiho
> > Reaktor Innovations Oy <URL: http://www.ri.fi/ >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> > For additional commands, e-mail: users-help@wicket.apache.org
> >
> >
> >
>
>
> -----
> ----------------
> Nikita Tovstoles
> vside.com
> ----------------
>
> --
> View this message in context:
> http://www.nabble.com/browser-back-button---shouldn%27t-onBeforeRender%28%29-execute--tp20508047p20544691.html
> Sent from the Wicket - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>
Re: browser back button - shouldn't onBeforeRender() execute?
Posted by dukehoops <ni...@doppelganger.com>.
Timo,
Thanks for your reply. But shouldn't the headers I listed disable caching
already? Re-pasting below:
Here are A's initial response headers:
Server Apache-Coyote/1.1
Cache-Control no-cache, max-age=0, must-revalidate
Pragma no-cache
Content-Type text/html;charset=UTF-8
Content-Language en-US
Content-Length 13209
Timo Rantalaiho wrote:
>
> On Fri, 14 Nov 2008, dukehoops wrote:
>> -user clicks browser back button and lands on A without server being hit
>> at
>> all.
>>
>> At this point I expected browser to issue GET /A and A's onBeforeRender
>> to
>> run. is my expectation correct? If not, what is the expected behavior.
>>
>> The reason for my question, is that I want to prevent user from
>> "back"-ing
>> to A once on B. So I wanted to use A's onBeforeRender to evaluate state
>> and
>> redirect someplace else. If my expectation above is incorrect, could
>> someone
>> suggest a better approach?
>
> That behaviour depends on the browser caching behaviour.
> Some brosers on some settings get page A from their cache,
> in which case the server is not being hit.
>
> You might get it to work by adding non-caching HTTP headers
> on page A.
>
> Best wishes,
> Timo
>
> --
> Timo Rantalaiho
> Reaktor Innovations Oy <URL: http://www.ri.fi/ >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>
>
-----
----------------
Nikita Tovstoles
vside.com
----------------
--
View this message in context: http://www.nabble.com/browser-back-button---shouldn%27t-onBeforeRender%28%29-execute--tp20508047p20544691.html
Sent from the Wicket - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org
Re: browser back button - shouldn't onBeforeRender() execute?
Posted by Timo Rantalaiho <Ti...@ri.fi>.
On Fri, 14 Nov 2008, dukehoops wrote:
> -user clicks browser back button and lands on A without server being hit at
> all.
>
> At this point I expected browser to issue GET /A and A's onBeforeRender to
> run. is my expectation correct? If not, what is the expected behavior.
>
> The reason for my question, is that I want to prevent user from "back"-ing
> to A once on B. So I wanted to use A's onBeforeRender to evaluate state and
> redirect someplace else. If my expectation above is incorrect, could someone
> suggest a better approach?
That behaviour depends on the browser caching behaviour.
Some brosers on some settings get page A from their cache,
in which case the server is not being hit.
You might get it to work by adding non-caching HTTP headers
on page A.
Best wishes,
Timo
--
Timo Rantalaiho
Reaktor Innovations Oy <URL: http://www.ri.fi/ >
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org