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

Form Input example fails when changing the language

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 1.5.1
    • Fix Version/s: 1.5.1
    • Component/s: wicket, wicket-examples
    • Labels:
      None

      Description

      Trying to change the language of http://localhost:8080/forminput example fails with:

      Caused by: java.lang.ArrayIndexOutOfBoundsException: -1
      at java.util.ArrayList.remove(ArrayList.java:390)
      at org.apache.wicket.request.Url.resolveRelative(Url.java:884)
      at org.apache.wicket.markup.html.form.Form.dispatchEvent(Form.java:1028)
      at org.apache.wicket.markup.html.form.Form.onFormSubmitted(Form.java:699)
      at org.apache.wicket.markup.html.form.Form.onFormSubmitted(Form.java:670)
      ... 37 more

        Activity

        Hide
        ivaynberg Igor Vaynberg added a comment -

        the patch was correct

        Show
        ivaynberg Igor Vaynberg added a comment - the patch was correct
        Hide
        ivaynberg Igor Vaynberg added a comment -

        the patch was correct

        Show
        ivaynberg Igor Vaynberg added a comment - the patch was correct
        Hide
        mgrigorov Martin Grigorov added a comment -

        The following patch fixes the problem but the comment in Form.dispatchEvent() makes me uncertain. It says that the current Url should be 'wicket/page?...' but actually it is just "?...".

        @@ -881,8 +881,10 @@
        public void resolveRelative(final Url relative)
        {
        // strip the first non-folder segment

        • getSegments().remove(getSegments().size() - 1);
          -
          + if (getSegments().size() > 0)
          + { + getSegments().remove(getSegments().size() - 1); + }
        Show
        mgrigorov Martin Grigorov added a comment - The following patch fixes the problem but the comment in Form.dispatchEvent() makes me uncertain. It says that the current Url should be 'wicket/page?...' but actually it is just "?...". @@ -881,8 +881,10 @@ public void resolveRelative(final Url relative) { // strip the first non-folder segment getSegments().remove(getSegments().size() - 1); - + if (getSegments().size() > 0) + { + getSegments().remove(getSegments().size() - 1); + }

          People

          • Assignee:
            ivaynberg Igor Vaynberg
            Reporter:
            mgrigorov Martin Grigorov
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development