Details
-
Improvement
-
Status: Open
-
Minor
-
Resolution: Unresolved
-
2.3.15.1, 2.3.15.2
Description
Currently, the ParametersInterceptor sets: ReflectionContextState.setCreatingNullObjects(contextMap, true)
This is great for parameters like "person.name=Phil" since it will create the Person object for you and then set the name.
However, sometimes you have a converter for a property that will set it as a whole, and you want to make sure that an empty object is never created. For example, "person=6", where the Person is set by looking it up by id. Currently, if someone messed with the url and made it "person[x]=6", XWork would end up creating an empty Person object. (Something along these lines happened to us and I was looking for a clean way to tell XWork to not allow it)
Perhaps the TypeConversion annotation could be extended to support this as an additional flag.