Details
Description
When I tell Wicket not to version pages by default via IPageSettings#setVersionPagesByDefault(false), created pages cannot be found later by theirs ID. Versioned pages are touched upon creation in dirty(boolean) method and thus stored in the page store. But unversioned ones are not! So when I create a Page, wrap it inside a PageProvider and RenderPageRequestHandler, then get its URL with urlFor, the URL is useless, because the page is referenced by its ID in the URL but it cannot be found by that URL later.
I'll give you an simple example.
PAGE 1:
public class WicketMainPage extends WebPage {
public WicketMainPage()
}
as you can see, I only create an instance of second page (which is not
bookmarkable as it has some parameters), wrap it in page provider and request
handler and simply output URL for it (of course it is an stateful URL).
The second page is just simple outputting text from constructor
PAGE 2:
public class PopupPage extends WebPage {
public PopupPage(String text)
}
When I run this, the app outputs an relative part of URL to the second page...
if I copy this into browser, everything works, when pages are versioned. But
when I set setVersionPagesByDefault(false) I start to get PageExpiredException
whe trying to access the second page. When I uncomment the touchPage line,
everythings works even with unversiones paged.
I think, that instead of explicitly touching the page, it should be done by
Wicket when retrieving the url for it. Somewhere in mapUrlFor or mapHandler,
etc... Or maybe it should be touched in the dirty method just like versioned pages.