Uploaded image for project: 'Wicket'
  1. Wicket
  2. WICKET-2911

continueToOriginalDestination does not work with mountBookmarkablePage and AjaxLink

    XMLWordPrintableJSON

Details

    Description

      I ran into the problem when I used @AuthorizeInstantiation annotations to protect ajax components from unauthorized instantiation. I reproduced without the use of a authorization strategy as follows:

      in HomePage

      add(new AjaxLink<Void>("ajaxLink") {
      @Override
      public void onClick(AjaxRequestTarget target)

      { throw new RestartResponseAtInterceptPageException(RedirectPage.class); }

      });

      In RedirectPage.class

      public void onSubmit()

      { super.onSubmit(); continueToOriginalDestination(); }

      If I first click the link in HomePage and then in submit the form in the RedirectPage I get

      ERROR - WicketFilter - closing the buffer error
      java.lang.NullPointerException
      at org.mortbay.jetty.Response.sendRedirect(Response.java:397)...

      (When I use it with mvn jetty:run I get a "No context on this server matched or handled this request." after the submit)

      This happens only when I use a AjaxLink and mount the HomePage (mountBookmarkablePage("/mounted/path", HomePage.class)

      With a non-ajax link or unmounted pages it works fine.

      I will attach a Quickstart.zip. Run in Eclipse to see the "ERROR - WicketFilter - closing the buffer error"

      Attachments

        1. redirectproblem.zip
          10 kB
          Conny Kuehne

        Activity

          People

            ivaynberg Igor Vaynberg
            ckuehne Conny Kuehne
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: