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

PropertyModel/PropertyResolver breaks when using a List as the root object

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 1.4.17, 1.5-RC5.1
    • 1.4.19, 1.5-RC6
    • wicket
    • None

    Description

      When using a java.util.List as the root target of a PropertyModel, and then using a property expression such as "[0].someProperty", PropertyResolver breaks rather badly, claiming that "0].somePropert" is not a valid property expression. Note the missing first and last characters.

      This happens because it first replaces all opening "[" with ".[", and thus we get a leading "." in the expression. That "." is then cut off, but the rest of the expression is suddenly treated as a single property name. A later step sees the leading "[" and thinks the whole thing is just a map/list index, and so drops the leading "[" and the last character (in the mistaken belief that the last character must be a "]".

      To make a long story short: The whole thing is fixed by eating the leading dots before entering the main resolver loop. I'm attaching patches for 1.4.x and trunk(1.5).

      Attachments

        Activity

          People

            mgrigorov Martin Tzvetanov Grigorov
            cmenzel Carl-Eric Menzel
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: