PropertyModel/PropertyResolver breaks when using a List as the root object
--------------------------------------------------------------------------
Key: WICKET-3929
URL: https://issues.apache.org/jira/browse/WICKET-3929
Project: Wicket
Issue Type: Bug
Components: wicket-core
Affects Versions: 1.5-RC5.1, 1.4.17
Reporter: Carl-Eric Menzel
Attachments:
1.4.x-0001-fix-problem-with-List-as-the-target-of-a-property-mo.patch,
1.5-0001-fix-problem-with-List-as-the-target-of-a-property-mo.patch
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).
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira