Oliver Bertuch opened SPR-16745 and commented

Dear devs of Spring,

I am currently developing some scientific reviewing software (https://github.com/peerpub/peerpub) and I try to use a multidimensional Map in my forms.

While single dimension maps work straight forward, adding more than 2 dimensions always results in errors. The code used to test this can be found here: https://github.com/peerpub/peerpub/tree/oliver_test_publisherform/src/main/java/de/fzj/peerpub/doc/publisher

Accessing the data within the view for adding a publisher is no problem. Trying to submit the test form, the following exception is thrown:

Request processing failed; nested exception is org.springframework.beans.InvalidPropertyException: Invalid property 'map[test][attribute][default]' of bean class [de.fzj.peerpub.doc.publisher.PublisherTestForm]: Illegal attempt to get property 'map' threw exception; nested exception is org.springframework.beans.NullValueInNestedPathException: Invalid property 'map[test][attribute][default]' of bean class [de.fzj.peerpub.doc.publisher.PublisherTestForm]: Cannot access indexed value of property referenced in indexed property path 'map[test][attribute][default]': returned null] with root cause

org.springframework.beans.NullValueInNestedPathException: Invalid property 'map[test][attribute][default]' of bean class [de.fzj.peerpub.doc.publisher.PublisherTestForm]: Cannot access indexed value of property referenced in indexed property path 'map[test][attribute][default]': returned null

Another (smaller) project where this error can be reproduced: https://github.com/poikilotherm/spring-mvc-test-utils/tree/support_mapOmap Just try to run the smoke test and watch it fail. I was trying to extend this helpfull utility by @f-lopes (see also https://github.com/f-lopes/spring-mvc-test-utils/issues/5) but as soon as I use more than 2 dimensions, I get data binding exceptions.

Within the docs, StackOverflow, the framework source code, JIRA, etc. I could not find a hint if this is supported (and how) or not. From my point of view it should be, of course... ;-)

Could you devs have the patience of the saints and enlighten my pleb mind with your knowledge?


Affects: 5.0.5

Reference URL: https://github.com/f-lopes/spring-mvc-test-utils/issues/5

Comment From: snicoll

@poikilotherm Sorry the issue got overlooked. I've tried to use the app but I didn't manage to make it work. Can you please share a small test that shows data binding with multidimensional maps, and it would be great if you didn't use Lombok as well, particularly on the topic of data binding.

Comment From: poikilotherm

This is no longer of interest, as I moved on from this project. Thanks for coming back to me anyway. Feel free to close.