Chase on 26/04/08 11:16, wrote:


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.

Sorry Chase, can you elaborate a little? You're talking about one of the S2 validations? I didn't see that in the list.

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to