-
Couldn't load subscription status.
- Fork 38.8k
Description
Rob Monie opened SPR-1671 and commented
When using nested paths such as "organisation.address.state" with a property editor for State intended to convert a String ID to a State object and back again, if address is null, a 'NullValueInNestedPathException' is thrown from BeanWrapperImpl. Is this the intended behaviour ?
Obviously if part of the nested path is null it is impossible to traverse the object graph to determine what property editor to use for the actual State property. However, if address is null then State is sure to be null also, so a generic handler of nulls could be possibly be applied.
The current workaround is to manually populate empty objects in the object graph in formBackingObject(). This does however require that these 'empty' placeholder objects need to be cleaned up before a save to prevent complications with incorrect data being pushed to the database.
Affects: 1.2.6
Issue Links:
- BeanWrapperImpl doesn't delegate Map-creation to propertyEdtior [SPR-3565] #8248 BeanWrapperImpl doesn't delegate Map-creation to propertyEdtior
- mvc: Dynamic List use case - allow collections/arrays to grow [SPR-4728] #9405 mvc: Dynamic List use case - allow collections/arrays to grow
- Data Binder: Add support for auto-instantiating null values in nested paths [SPR-6032] #10701 Data Binder: Add support for auto-instantiating null values in nested paths
- Null property values in nested paths relating to <spring:bind> tag, <form:xxx> tags, and ServletRequestDataBinder [SPR-1860] #6554 Null property values in nested paths relating to spring:bind tag, form:xxx tags, and ServletRequestDataBinder
- <form> tag library should WARN instead of blowup when command missing [SPR-2607] #7296 tag library should WARN instead of blowup when command missing
38 votes, 37 watchers