Wicket
  1. Wicket
  2. WICKET-4997

Mounted bookmarkable Page not recreated on Session Expiry

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 6.4.0
    • Fix Version/s: 6.13.0, 7.0.0-M1
    • Component/s: wicket
    • Labels:
      None
    • Environment:
      JDK 7, GlassFish 3.1.2.2

      Description

      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?

      1. WICKET-4997-bernard-sources.zip
        44 kB
        bernard
      2. TestCase.zip
        12 kB
        bernard

        Issue Links

          Activity

          bernard created issue -
          Martin Grigorov made changes -
          Field Original Value New Value
          Assignee Pedro Santos [ pedrosans ]
          bernard made changes -
          Attachment TestCase.zip [ 12566248 ]
          bernard made changes -
          Description With the default true of org.apache.wicket.settings.IPageSettings#getRecreateMountedPagesAfterExpiry() PageExpiryException is thrown a when any one of its links 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 copyed 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?
          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 copyed 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?
          bernard made changes -
          Description 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 copyed 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?
          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?
          Emond Papegaaij made changes -
          Link This issue relates to WICKET-5084 [ WICKET-5084 ]
          bernard made changes -
          Attachment WICKET-4997-bernard-sources.zip [ 12599140 ]
          Emond Papegaaij made changes -
          Status Open [ 1 ] Resolved [ 5 ]
          Assignee Pedro Santos [ pedrosans ] Emond Papegaaij [ papegaaij ]
          Fix Version/s 6.13.0 [ 12325564 ]
          Fix Version/s 7.0.0 [ 12322958 ]
          Resolution Fixed [ 1 ]
          Alexander Suslov made changes -
          Link This issue is related to WICKET-5521 [ WICKET-5521 ]

            People

            • Assignee:
              Emond Papegaaij
              Reporter:
              bernard
            • Votes:
              3 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development