struts-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Chase <ch...@osdev.org>
Subject Re: Fundamental flaw in Model-Driven?
Date Sat, 26 Apr 2008 10:16:31 GMT

>
> I also stumbled across this problem.
>
> One solution could be to use a TypeConverter to instantiate new, 
> unmanaged entities during the ParamsInterceptor invocation.
>
> Such a TypeConverter could pass back instantiated, blank entities 
> (with nothing but the ID) for ParamsInterceptor to collate, and 
> against which ValidationInterceptor can operate. E.g. for param 
> 'bean=69', the type converter instantiates Bean and calls setId(69)
>
> Once Validation succeeds, ModelDriven and ParamsInterceptor should be 
> invoked again to update the managed entities.
>
> The unmanaged entities would just disappear out of scope and be 
> garbage collected.
>
> Such a strategy would require modification to ParamsInterceptor to 
> tell it to use the initial TypeConverter on the first call, but not on 
> the second. Whether the algorithm that controls that is accessible for 
> modification in the ParamsInterceptor or whether it is out-of-reach in 
> OGNL somewhere, I'm not sure.
>
If it was a blank (just id) entity then you'd lose the ability to 
validate "num1 > num2" where num1 was set by the params interceptor but 
num2 came from the database.

-Chase

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


Mime
View raw message