You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@isis.apache.org by "Andi Huber (Jira)" <ji...@apache.org> on 2021/02/17 09:18:00 UTC

[jira] [Comment Edited] (ISIS-2530) Wicket: switch session timeout policy to not recreate expired pages

    [ https://issues.apache.org/jira/browse/ISIS-2530?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17283570#comment-17283570 ] 

Andi Huber edited comment on ISIS-2530 at 2/17/21, 9:17 AM:
------------------------------------------------------------

Martin Grigorov:
EntityPage is being opened by the user, then after X mins the session expires, but the user credentials are stored and any interaction with the app transparently creates a new session and tries to continue like an expiration haven't happened at all.

then Wicket tries to execute the action (Link click in this case) and complains that the Component cannot be found on the current page

i.e. before the expiration the page being shown had a Component with path "theme:welcome" but after the re-creation there is no such component in the new page and Wicket fails ...
https://github.com/apache/wicket/blob/11dc8f94b93216bd72c61cd5ba94946a8f89af1c/wicket-core/src/main/java/org/apache/wicket/settings/PageSettings.java#L46

by default Wicket will create a fresh instance of the page if there is an info of its type, i.e. EntityPage, in the url

if you do getPageSettings().setRecreateBookmarkablePagesAfterExpiry(false) at https://github.com/apache/isis/blob/9691c1e2344a3b260624823720cd69b519453c5f/viewers/wicket/viewer/src/main/java/org/apache/isis/viewer/wicket/viewer/wicketapp/IsisWicketApplication.java#L210 then Wicket will throw PageExpiredException instead of creating a fresh instance

and this code will kick-in https://github.com/apache/isis/blob/d14adde6b82c8c0c02d7195490cc99dc1faff199/viewers/wicket/viewer/src/main/java/org/apache/isis/viewer/wicket/viewer/integration/WebRequestCycleForIsis.java#L251






was (Author: hobrom):
Martin Grigorov:
EntityPage is being opened by the user, then after X mins the session expires, but the user credentials are stored and any interaction with the app transparently creates a new session and tries to continue like an expiration haven't happened at all.

then Wicket tries to execute the action (Link click in this case) and complains that the Component cannot be found on the current page

i.e. before the expiration the page being shown had a Component with path "theme:welcome" but after the re-creation there is no such component in the new page and Wicket fails ...
https://github.com/apache/wicket/blob/11dc8f94b93216bd72c61cd5ba94946a8f89af1c/wicket-core/src/main/java/org/apache/wicket/settings/PageSettings.java#L46

by default Wicket will create a fresh instance of the page if there is an info of its type, i.e. EntityPage, in the url

if you do getPageSettings().setRecreateBookmarkablePagesAfterExpiry(false) at https://github.com/apache/isis/blob/9691c1e2344a3b260624823720cd69b519453c5f/viewe[…]/isis/viewer/wicket/viewer/wicketapp/IsisWicketApplication.java then Wicket will throw PageExpiredException instead of creating a fresh instance

and this code will kick-in https://github.com/apache/isis/blob/d14adde6b82c8c0c02d7195490cc99dc1faff199/viewe[…]is/viewer/wicket/viewer/integration/WebRequestCycleForIsis.java





> Wicket: switch session timeout policy to not recreate expired pages
> -------------------------------------------------------------------
>
>                 Key: ISIS-2530
>                 URL: https://issues.apache.org/jira/browse/ISIS-2530
>             Project: Isis
>          Issue Type: Improvement
>          Components: Isis Viewer Wicket
>            Reporter: Andi Huber
>            Assignee: Andi Huber
>            Priority: Minor
>             Fix For: 2.0.0-M5
>
>
> Martin Hesse: I came across this wicket error message I get when I click on a link or a menu entry after a being "away from the keyboard" for a while, saying "Unable to find component with id 'welcome' in [WebMarkupContainer [Component id = theme]] Expected: 'theme:welcome'. Found with similar names: ''"



--
This message was sent by Atlassian Jira
(v8.3.4#803005)