Re: Force page expiration

2009-10-28 Thread Tomás Rossi

Ok... Our page had a StatelessForm inside. We changed it to just Form.

When the form was submitted, we had a bookmarkable page as a response 
page and now we changed the call to produce a non-bookmarkable page. 
This is:


onSubmit() {
...
//setResponsePage(MyResponsePage.class); // - REMOVED
setResponsePage(new MyResponsePage()); // - ADDED
...
}

With this (and no need to clear the pagemap) a submit after a back 
button produces a page expired message.


If I make the form stateless again, kaboom!

Questions:
1) Why setting bookmarkable or not bookmarkable response page makes the 
difference between expiring and not expiring the current page?
2) What determines if a page is stateless or stateful? Is it just the 
fact that it contains stateless or stateful forms?
3) Is there a way I can expire the current page if I set a bookmarkable 
response page?


We feel Wicket is a great framework, but there are things we don't yet 
understand. Mainly, we get really confused on how does Wicket handle 
back button, what are and what distinguishes stateless or stateful 
pages, what are versioned pages/components, what problems they solve and 
how to use them. If anyone can point us where to read on these subjects 
we'll appreciate it very much.


Kind regards and thanks,

Tom;

Pedro Santos escribió:

You are aware that to an page expire, it has to be statefull, right?
In a statefull page:
getPage().getPageMap().clear()
and the previous versions will to be removed from pagemap, then you got the
page expired when try to back to then...

On Tue, Oct 27, 2009 at 4:05 PM, Tomás Rossi tro...@mecon.gov.ar wrote:

  

Nothing seems to work.

Does the fact that the page I want to expire is the home page has anything
to do with it?

Pedro Santos escribió:

 The page returned from back button came from pagemap. Make sure to remove


it
from there and you get the expired exception.

On Tue, Oct 27, 2009 at 11:57 AM, Tomás Rossi tro...@mecon.gov.ar
wrote:



  

Hi, I have another question...

in Wicket (1.4.2), can I force the expiration of a page?
Specifically, if users hit browser's back-button, I'd like to show them
the
page-expired message.

I've already tried to invalidate the session, but I got a horrible
exception when re-submitting the form after reaching it through the back
button.

Thanks in advance,
--
Tom;



-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org








  

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org






  



-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: Force page expiration

2009-10-28 Thread Pedro Santos
1) Why setting bookmarkable or not bookmarkable response page makes the
difference between expiring and not expiring the current page?
Basically, the page instances are versioned to framework be able to get them
back. The default versioning implementation encode page version information
at url. As bookmarkable pages don't have such information encoded on they
ulr, just a new pagemap are created for they.

2) What determines if a page is stateless or stateful? Is it just the fact
that it contains stateless or stateful forms?
It is stateless by default. Contain an statefull component (as form) is
enough to page turn to statefull

3) Is there a way I can expire the current page if I set a bookmarkable
response page?
yes, just: (if I understand your question)
getPageMap().clear();
setResponsePage(MyStatelessPage);
so
1- go to stateless page 1
2 - go to statefull page 2
3 - clean the pagemap go to stateless page 1
4 - click at back button and the page is expired...

If anyone can point us where to read on these subjects we'll appreciate it
very much.

http://cwiki.apache.org/WICKET/page-maps.html

On Wed, Oct 28, 2009 at 1:43 PM, Tomás Rossi tro...@mecon.gov.ar wrote:

 Ok... Our page had a StatelessForm inside. We changed it to just Form.

 When the form was submitted, we had a bookmarkable page as a response page
 and now we changed the call to produce a non-bookmarkable page. This is:

 onSubmit() {
 ...
 //setResponsePage(MyResponsePage.class); // - REMOVED
 setResponsePage(new MyResponsePage()); // - ADDED
 ...
 }

 With this (and no need to clear the pagemap) a submit after a back button
 produces a page expired message.

 If I make the form stateless again, kaboom!

 Questions:
 1) Why setting bookmarkable or not bookmarkable response page makes the
 difference between expiring and not expiring the current page?
 2) What determines if a page is stateless or stateful? Is it just the fact
 that it contains stateless or stateful forms?
 3) Is there a way I can expire the current page if I set a bookmarkable
 response page?

 We feel Wicket is a great framework, but there are things we don't yet
 understand. Mainly, we get really confused on how does Wicket handle back
 button, what are and what distinguishes stateless or stateful pages, what
 are versioned pages/components, what problems they solve and how to use
 them. If anyone can point us where to read on these subjects we'll
 appreciate it very much.

 Kind regards and thanks,

 Tom;

 Pedro Santos escribió:

  You are aware that to an page expire, it has to be statefull, right?
 In a statefull page:
 getPage().getPageMap().clear()
 and the previous versions will to be removed from pagemap, then you got
 the
 page expired when try to back to then...

 On Tue, Oct 27, 2009 at 4:05 PM, Tomás Rossi tro...@mecon.gov.ar wrote:



 Nothing seems to work.

 Does the fact that the page I want to expire is the home page has
 anything
 to do with it?

 Pedro Santos escribió:

  The page returned from back button came from pagemap. Make sure to
 remove


 it
 from there and you get the expired exception.

 On Tue, Oct 27, 2009 at 11:57 AM, Tomás Rossi tro...@mecon.gov.ar
 wrote:





 Hi, I have another question...

 in Wicket (1.4.2), can I force the expiration of a page?
 Specifically, if users hit browser's back-button, I'd like to show them
 the
 page-expired message.

 I've already tried to invalidate the session, but I got a horrible
 exception when re-submitting the form after reaching it through the
 back
 button.

 Thanks in advance,
 --
 Tom;



 -
 To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
 For additional commands, e-mail: users-h...@wicket.apache.org










 -
 To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
 For additional commands, e-mail: users-h...@wicket.apache.org










 -
 To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
 For additional commands, e-mail: users-h...@wicket.apache.org




-- 
Pedro Henrique Oliveira dos Santos


Re: Force page expiration

2009-10-28 Thread Tomás Rossi
1) So, what does the fact that it creates a new pagemap (or not) has to 
do with the current page been expired or not? I mean, I understand the 
URL encode for the page versioning stuff, but I don't get why the page 
is not expired. Maybe because when I hit the back button, the URL points 
to the last created page on the pagemap instead of pointing to an old one?


2) Let me see if I get it right. A page that changes it's component tree 
is stateful (like the guestbook example) and one that only changes it's 
content through it's models is stateless. Am I right? In that case, why 
shouldn't I think a feedback panel as a stateless component (and thus 
stateless the page which contains it)?


3) That didn't work for me... I'll give it another try.

Pedro Santos escribió:

1) Why setting bookmarkable or not bookmarkable response page makes the
difference between expiring and not expiring the current page?
Basically, the page instances are versioned to framework be able to get them
back. The default versioning implementation encode page version information
at url. As bookmarkable pages don't have such information encoded on they
ulr, just a new pagemap are created for they.

2) What determines if a page is stateless or stateful? Is it just the fact
that it contains stateless or stateful forms?
It is stateless by default. Contain an statefull component (as form) is
enough to page turn to statefull

3) Is there a way I can expire the current page if I set a bookmarkable
response page?
yes, just: (if I understand your question)
getPageMap().clear();
setResponsePage(MyStatelessPage);
so
1- go to stateless page 1
2 - go to statefull page 2
3 - clean the pagemap go to stateless page 1
4 - click at back button and the page is expired...

If anyone can point us where to read on these subjects we'll appreciate it
very much.

http://cwiki.apache.org/WICKET/page-maps.html

On Wed, Oct 28, 2009 at 1:43 PM, Tomás Rossi tro...@mecon.gov.ar wrote:

  

Ok... Our page had a StatelessForm inside. We changed it to just Form.

When the form was submitted, we had a bookmarkable page as a response page
and now we changed the call to produce a non-bookmarkable page. This is:

onSubmit() {
...
//setResponsePage(MyResponsePage.class); // - REMOVED
setResponsePage(new MyResponsePage()); // - ADDED
...
}

With this (and no need to clear the pagemap) a submit after a back button
produces a page expired message.

If I make the form stateless again, kaboom!

Questions:
1) Why setting bookmarkable or not bookmarkable response page makes the
difference between expiring and not expiring the current page?
2) What determines if a page is stateless or stateful? Is it just the fact
that it contains stateless or stateful forms?
3) Is there a way I can expire the current page if I set a bookmarkable
response page?

We feel Wicket is a great framework, but there are things we don't yet
understand. Mainly, we get really confused on how does Wicket handle back
button, what are and what distinguishes stateless or stateful pages, what
are versioned pages/components, what problems they solve and how to use
them. If anyone can point us where to read on these subjects we'll
appreciate it very much.

Kind regards and thanks,

Tom;

Pedro Santos escribió:

 You are aware that to an page expire, it has to be statefull, right?


In a statefull page:
getPage().getPageMap().clear()
and the previous versions will to be removed from pagemap, then you got
the
page expired when try to back to then...

On Tue, Oct 27, 2009 at 4:05 PM, Tomás Rossi tro...@mecon.gov.ar wrote:



  

Nothing seems to work.

Does the fact that the page I want to expire is the home page has
anything
to do with it?

Pedro Santos escribió:

 The page returned from back button came from pagemap. Make sure to
remove




it
from there and you get the expired exception.

On Tue, Oct 27, 2009 at 11:57 AM, Tomás Rossi tro...@mecon.gov.ar
wrote:





  

Hi, I have another question...

in Wicket (1.4.2), can I force the expiration of a page?
Specifically, if users hit browser's back-button, I'd like to show them
the
page-expired message.

I've already tried to invalidate the session, but I got a horrible
exception when re-submitting the form after reaching it through the
back
button.

Thanks in advance,
--
Tom;



-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org










  

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org








  

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org






  




Re: Force page expiration

2009-10-28 Thread Tomás Rossi

Thank you for your time.

Now we know that all of our pages must be stateless AND we need it to 
expire them anyway. Maybe Wicket is not prepared for this so we'll try 
it manually.


Pedro Santos escribió:
1) The browser keep the page url on his history. If that url don't has 
any historical information, the server will think the user want a new 
page.
2)Every component is stateless until you change it. You make an 
component statefull adding it an statefull behavior, or overriding the 
getStatelessHint method.

3)Sending an zip wiht an stateless page and an statefull page.
you can test like:

1- go to stateless page
2 - go to statefull page
3 - go to stateless page AND clear the pagemap (it has to be done 
after the page 2 get into the pagemap)
4 - click at back button and the page is expired... ( if you are using 
firefox, just clean the cache before this step!)


It work fine on IE. On firefox, for some reason, the page got cached 
on the browser! I add some meta tags to avoid it but nothing... Tomás, 
mayb it is what is happening on your project too. Make sure the 
firefox don't cache your pages.


On Wed, Oct 28, 2009 at 3:46 PM, Tomás Rossi tro...@mecon.gov.ar 
mailto:tro...@mecon.gov.ar wrote:


1) So, what does the fact that it creates a new pagemap (or not)
has to do with the current page been expired or not? I mean, I
understand the URL encode for the page versioning stuff, but I
don't get why the page is not expired. Maybe because when I hit
the back button, the URL points to the last created page on the
pagemap instead of pointing to an old one?

2) Let me see if I get it right. A page that changes it's
component tree is stateful (like the guestbook example) and one
that only changes it's content through it's models is stateless.
Am I right? In that case, why shouldn't I think a feedback panel
as a stateless component (and thus stateless the page which
contains it)?

3) That didn't work for me... I'll give it another try.

Pedro Santos escribió:

1) Why setting bookmarkable or not bookmarkable response page
makes the
difference between expiring and not expiring the current page?
Basically, the page instances are versioned to framework be
able to get them
back. The default versioning implementation encode page
version information
at url. As bookmarkable pages don't have such information
encoded on they
ulr, just a new pagemap are created for they.

2) What determines if a page is stateless or stateful? Is it
just the fact
that it contains stateless or stateful forms?
It is stateless by default. Contain an statefull component (as
form) is
enough to page turn to statefull

3) Is there a way I can expire the current page if I set a
bookmarkable
response page?
yes, just: (if I understand your question)
getPageMap().clear();
setResponsePage(MyStatelessPage);
so
1- go to stateless page 1
2 - go to statefull page 2
3 - clean the pagemap go to stateless page 1
4 - click at back button and the page is expired...

If anyone can point us where to read on these subjects we'll
appreciate it
very much.

http://cwiki.apache.org/WICKET/page-maps.html

On Wed, Oct 28, 2009 at 1:43 PM, Tomás Rossi
tro...@mecon.gov.ar mailto:tro...@mecon.gov.ar wrote:

 


Ok... Our page had a StatelessForm inside. We changed it
to just Form.

When the form was submitted, we had a bookmarkable page as
a response page
and now we changed the call to produce a non-bookmarkable
page. This is:

onSubmit() {
...
//setResponsePage(MyResponsePage.class); // - REMOVED
setResponsePage(new MyResponsePage()); // - ADDED
...
}

With this (and no need to clear the pagemap) a submit
after a back button
produces a page expired message.

If I make the form stateless again, kaboom!

Questions:
1) Why setting bookmarkable or not bookmarkable response
page makes the
difference between expiring and not expiring the current page?
2) What determines if a page is stateless or stateful? Is
it just the fact
that it contains stateless or stateful forms?
3) Is there a way I can expire the current page if I set a
bookmarkable
response page?

We feel Wicket is a great framework, but there are things
we don't yet
understand. Mainly, we get really confused on how does
Wicket handle back
button, what are and what distinguishes stateless or
stateful pages, what
  

Re: Force page expiration

2009-10-27 Thread Pedro Santos
The page returned from back button came from pagemap. Make sure to remove it
from there and you get the expired exception.

On Tue, Oct 27, 2009 at 11:57 AM, Tomás Rossi tro...@mecon.gov.ar wrote:

 Hi, I have another question...

 in Wicket (1.4.2), can I force the expiration of a page?
 Specifically, if users hit browser's back-button, I'd like to show them the
 page-expired message.

 I've already tried to invalidate the session, but I got a horrible
 exception when re-submitting the form after reaching it through the back
 button.

 Thanks in advance,
 --
 Tom;



 -
 To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
 For additional commands, e-mail: users-h...@wicket.apache.org




-- 
Pedro Henrique Oliveira dos Santos


Re: Force page expiration

2009-10-27 Thread Tomás Rossi

Nothing seems to work.

Does the fact that the page I want to expire is the home page has 
anything to do with it?


Pedro Santos escribió:

The page returned from back button came from pagemap. Make sure to remove it
from there and you get the expired exception.

On Tue, Oct 27, 2009 at 11:57 AM, Tomás Rossi tro...@mecon.gov.ar wrote:

  

Hi, I have another question...

in Wicket (1.4.2), can I force the expiration of a page?
Specifically, if users hit browser's back-button, I'd like to show them the
page-expired message.

I've already tried to invalidate the session, but I got a horrible
exception when re-submitting the form after reaching it through the back
button.

Thanks in advance,
--
Tom;



-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org






  



-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: Force page expiration

2009-10-27 Thread Pedro Santos
You are aware that to an page expire, it has to be statefull, right?
In a statefull page:
getPage().getPageMap().clear()
and the previous versions will to be removed from pagemap, then you got the
page expired when try to back to then...

On Tue, Oct 27, 2009 at 4:05 PM, Tomás Rossi tro...@mecon.gov.ar wrote:

 Nothing seems to work.

 Does the fact that the page I want to expire is the home page has anything
 to do with it?

 Pedro Santos escribió:

  The page returned from back button came from pagemap. Make sure to remove
 it
 from there and you get the expired exception.

 On Tue, Oct 27, 2009 at 11:57 AM, Tomás Rossi tro...@mecon.gov.ar
 wrote:



 Hi, I have another question...

 in Wicket (1.4.2), can I force the expiration of a page?
 Specifically, if users hit browser's back-button, I'd like to show them
 the
 page-expired message.

 I've already tried to invalidate the session, but I got a horrible
 exception when re-submitting the form after reaching it through the back
 button.

 Thanks in advance,
 --
 Tom;



 -
 To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
 For additional commands, e-mail: users-h...@wicket.apache.org










 -
 To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
 For additional commands, e-mail: users-h...@wicket.apache.org




-- 
Pedro Henrique Oliveira dos Santos