struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Robert Graf-Waczenski <...@lsoft.com>
Subject Re: Binding multiple values to a single immutable object
Date Tue, 03 Nov 2009 11:23:10 GMT
Gareth Davis schrieb:
> The more I look at the Ognl stuff and the ParametersIntercepter the
> more I've convincing my self that this is just not possible with the
> framework, can anybody confirm this?
>   

Others may have a deeper knowledge of the framework, but i would 
approach your issue differently. Since setters for your html form fields 
are called independently of each other and in an unpredictable order, 
you should code your action to have separate members for each of the 
getters/setters and have your Date instance created properly in your 
action method. Or you implement a weaker form of immutability that 
allows an object to shortly exist in an non-immutable state (so you can 
new it with empty members and have it being accessed directly from your 
setters) and then "petrify" the object in your action method. We in our 
project have invented such a pattern ten years ago and are using it ever 
since without looking back :-)

Robert


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Mime
View raw message