Prevent PageExpired

43 Views Asked by At

i have this problem in my wicket app. i am using wicket 6.13;

This is step by step what happen:

- PageA is opened.
- user click on button close twice or more times, clicking on that button cause PageA to be closed and PageB to be opened
- PageExpired occurs 

First request from the click on the close button is executed and PageA is closed and PageB is opened. Next request from the click on the close button can not find the page in the touch pages so PageExpired is thrown.

Any idea how can I prevent the second request from executing so the application can continue to work properly?

Thanks Sretan

1

There are 1 best solutions below

0
martin-g On

By default PageA should be not only in the touchedPages (in memory) but also in the DiskStore (on the hard disk/SSD), so Wicket should be able to find the page by its id.

I am not sure whether 6.13 has it (because it is very old) but the Javadoc of PageExpiredException lists the possible reasons for this exception:

  • the page have never been stored there, e.g. an error occurred during the storing process
  • the http session has expired and thus all pages related to this session are erased too
  • the page instance has been erased because the store size exceeded

I guess the first reason is the problem in the your case.