Hi all.
 
I love the ability of Struts to perform syntactic validation of input data
and automatically redisplay the screen + data + error messages.  However,
I'm reluctant to put semantic validation checks anywhere but the business
objects to which they belong.  For example, I have a rule that says an
organization's effective date cannot be in the future.  I consider that part
of what it means to be an organization in my domain, therefore logical
places to enforce the rule are either the appropriate setter or a
preCommit() persistence callback method.  However, when using something like
BeanUtils to copy values from my value objects to my persistent domain
objects, if an exception is thrown in the setter (or even later at commit()
time), what's the best way to propagate that back to the user?  BeanUtils
will throw an exception as soon as the underlying setter throws one,
regardless of whether there are further semantic validations (on other
properties) to perform.  I'd like it to appear to the user the same way as
when the Struts validator flags a problem.
 
thanks
 
john gregg
Wells Fargo Services Company
Minneapolis, MN
 


Reply via email to