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

Switching from HttsRequired page to http page with forms in both pages

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 1.5-RC1
    • 1.5-RC2
    • wicket
    • None
    • 1.5-SNAPSHOT

    Description

      There are two pages TestPage (homepage, HttsRequired) and TestPage2 (http only).
      TestPage2 contains empty form:

      add(new Form<Void>("form"));

      TestPage contains a form with a single submit button:

      Form<String> form = new Form<String>("form", new Model<String>()) {

      private static final long serialVersionUID = 7401870238638554392L;

      @Override
      protected void onSubmit()

      { setResponsePage(TestPage2.class); }

      };
      add(form);

      When the form is submitted a NullPointerException is throw during the render of TestPage2:

      java.lang.NullPointerException
      at org.apache.wicket.markup.html.form.Form.onComponentTag(Form.java:1400)
      at org.apache.wicket.Component.internalRenderComponent(Component.java:2473)
      at org.apache.wicket.MarkupContainer.onRender(MarkupContainer.java:1475)
      at org.apache.wicket.Component.internalRender(Component.java:2366)
      ..................

      This exception is thrown in TestPage2's form in the method onComponentTag on line 1400:

      String url = getActionUrl().toString();

      because getActionUrl() returns null. Debugging getActionUrl leads to RequestCycle->mapUrlFor and there requestMapper.mapHandler(handler); fails to map the handler. The "handler" variable is of type SwitchProtocolRequestHandler.

      This can be reproduced with the attached quickstart. It's using the default ports (80 and 443) and a self-signed certificate (hope there are no problems with it).

      Attachments

        1. quickstart.rar
          8 kB
          Ivan Vasilev

        Activity

          People

            ivaynberg Igor Vaynberg
            hok Ivan Vasilev
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: