Wicket
  1. Wicket
  2. WICKET-3442

setResponsePage() to mounted Page fails to redirect correctly

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.5-RC1
    • Fix Version/s: 1.5-RC2
    • Component/s: wicket
    • Labels:
      None
    • Environment:
      Reproduced this on Jetty 6.1.23 on Sun JDK on Ubuntu, as well as the Quickstart Jetty on Sun JDK on Windows 7

      Description

      calling setResponsePage() within a Form#onSubmit( ) to a mounted Page will:

      1. Not redirect to the mounted URI
      2. Screw up path rewriting for all elements on the rendered page.

      I have attached a quickstart zipfile in which I am able to reproduce the issue. Here's a quick description of what happens:

      PageOne.class is mounted to /pageone
      PageTwo.class is mounted to /pagetwo

      PageOne has a Form with a single setResponsePage( PageTwo.class ); in its onSubmit( );

      When PageOne's form is submitted, instead of redirecting to /pagetwo, the page uri is something like /wicket/page?0-1.IFormSubmitListener-form

      Any subsequent path references on the rendering of PageTwo are broken, since the browser thinks the relative path origin is /wicket/, whereas wicket likely thinks it's /

      1. brokenform.zip
        22 kB
        David Hansen

        Issue Links

          Activity

          Hide
          David Hansen added a comment -

          Quickstart with reproducable test case

          Show
          David Hansen added a comment - Quickstart with reproducable test case
          Hide
          David Hansen added a comment -

          As a followup comment to this issue, I found a workaround.

          if you add any Form at all to the target page, wicket will function correctly. By adding the following to my Base WebPage, the issue goes away completely:

          add( new Form( "kludgyhack" ) );

          Show
          David Hansen added a comment - As a followup comment to this issue, I found a workaround. if you add any Form at all to the target page, wicket will function correctly. By adding the following to my Base WebPage, the issue goes away completely: add( new Form( "kludgyhack" ) );

            People

            • Assignee:
              Igor Vaynberg
              Reporter:
              David Hansen
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development