You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@struts.apache.org by "Lukasz Lenart (JIRA)" <ji...@apache.org> on 2014/03/08 17:52:43 UTC
[jira] [Updated] (WW-4203) Allow disabling xwork creating null
objects on a property level
[ https://issues.apache.org/jira/browse/WW-4203?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Lukasz Lenart updated WW-4203:
------------------------------
Fix Version/s: (was: 2.3.17)
2.3.x
> Allow disabling xwork creating null objects on a property level
> ---------------------------------------------------------------
>
> Key: WW-4203
> URL: https://issues.apache.org/jira/browse/WW-4203
> Project: Struts 2
> Issue Type: Improvement
> Components: Core Interceptors
> Affects Versions: 2.3.15.1, 2.3.15.2
> Reporter: Jasper Rosenberg
> Priority: Minor
> Labels: interceptors, typeconverter, xwork
> Fix For: 2.3.x
>
>
> 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.
--
This message was sent by Atlassian JIRA
(v6.2#6252)