[
https://issues.apache.org/jira/browse/WICKET-4997?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13744098#comment-13744098
]
bernard commented on WICKET-4997:
---------------------------------
On the other hand expiry in the non-bookmarkable constructor case can be
handled nicely in the constructor with a customised response so
Page#isBookmarkable() is more flexible and less disrupting to the user. We just
don't want PageExpiredException. That weakens the point in my last comment.
In other words if the developer codes bookmarkable constructors then these
constructors must be supported properly i.e. validated.
This is the kind of scenario that makes me I think that Wicket should call a
no-args page constructor instead of creating bogus PageParameters, if no
PageParameters are provided.
Also, regarding your concern, there is still an outstanding issue WICKET-5068.
When we get the PageParameters back, then there is less motivation to prevent
the page from being re-created.
BTW this fixes WICKET-5043 which is essentially a duplicate of this issue.
> Mounted bookmarkable Page not recreated on Session Expiry
> ---------------------------------------------------------
>
> Key: WICKET-4997
> URL: https://issues.apache.org/jira/browse/WICKET-4997
> Project: Wicket
> Issue Type: Bug
> Components: wicket
> Affects Versions: 6.4.0
> Environment: JDK 7, GlassFish 3.1.2.2
> Reporter: bernard
> Assignee: Pedro Santos
> Attachments: TestCase.zip
>
>
> With the default true of
> org.apache.wicket.settings.IPageSettings#getRecreateMountedPagesAfterExpiry()
> PageExpiryException is thrown when a Link on a page is clicked.
> I find it very useful and in fact indispensible to rely on
> RecreateMountedPagesAfterExpiry especially on logout links.
> But it doesn't seem to work for me in 6.4.0. I think this is because
> Link#getUrl() calls Component#utlFor() which requires a stateless page for
> this to work:
> if (page.isPageStateless())
> {
> handler = new
> BookmarkableListenerInterfaceRequestHandler(provider, listener);
> }
> else
> {
> handler = new ListenerInterfaceRequestHandler(provider,
> listener);
> }
> With a stateless page a url is:
> http://localhost:8080/wicket/HomePage?-1.ILinkListener-toolBar-signout
> With a non stateless but bookmarkable page a url is:
> http://localhost:8080/wicket/page?1-1.ILinkListener-toolBar-signout
> So I guess that a stateful page cannot be recovered because after session
> expiry Wicket cannot find out what the page is. It is not coded in the URL.
> Looking at the semantics of UrlFor(), I thought this might be a bug and I
> copied and changed the code in my Link subclass from
> // if (page.isPageStateless()) {
> to:
> if (page.isBookmarkable()) {
>
> It works as expected but I don't know whether it would break other things if
> implemented in Wicket.
> I guess I am not the only one who needs recovery for bookmarkable pages in
> this way. Would it be possible to change Wicket to fix this so it becomes
> possible?
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira