Wicket
  1. Wicket
  2. WICKET-5078

RestartResponseException broken with page instance and bookmarkable page

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 6.6.0
    • Fix Version/s: 6.7.0, 1.5.11
    • Component/s: wicket
    • Labels:
      None

      Description

      If I do throw new RestartResponseException(new OtherPage("redirected!")); on OtherPage itself and OtherPage is mounted then a completely new page is constructed and displayed instead of the instance I created.

      Does not happen if the page isn't mounted or the current page is not OtherPage. If I hide the default constructor it also doesn't happen.

      I'll attach a quickstart which demonstrates the problem.

        Activity

        Hide
        Martin Grigorov added a comment -

        From now on "new RestartResponseException(IRequestablePage)" will mark the page as stateful to preserve it after the redirect. The same as in RequestCycle#setResponsePage(IRequestablePage) (WICKET-3965)

        Show
        Martin Grigorov added a comment - From now on "new RestartResponseException(IRequestablePage)" will mark the page as stateful to preserve it after the redirect. The same as in RequestCycle#setResponsePage(IRequestablePage) ( WICKET-3965 )
        Hide
        Martin Grigorov added a comment -

        I think this should be improved.
        org.apache.wicket.request.cycle.RequestCycle#setResponsePage(IRequestablePage) sets the stateless hint to false just to make sure that stateless pages are stored and used after the redirect.
        See WICKET-3965.

        Show
        Martin Grigorov added a comment - I think this should be improved. org.apache.wicket.request.cycle.RequestCycle#setResponsePage(IRequestablePage) sets the stateless hint to false just to make sure that stateless pages are stored and used after the redirect. See WICKET-3965 .
        Hide
        Sven Meier added a comment -

        If you're wondering why OtherPage is stateless although it contains an AjaxLink:
        You're adding the AjaxLink in #onInitialize(), that's too late to influence the stateless detection, since a page's #onInitialize() is called shortly before render only .

        Show
        Sven Meier added a comment - If you're wondering why OtherPage is stateless although it contains an AjaxLink: You're adding the AjaxLink in #onInitialize(), that's too late to influence the stateless detection, since a page's #onInitialize() is called shortly before render only .
        Hide
        Sven Meier added a comment -

        OtherPage is stateless and mounted, thus Wicket assumes that it can safely be recreated as needed.

        Show
        Sven Meier added a comment - OtherPage is stateless and mounted, thus Wicket assumes that it can safely be recreated as needed.

          People

          • Assignee:
            Martin Grigorov
            Reporter:
            Christoph Leiter
          • Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development