Thank you Gunnar, Very much appreciated. I have had a look into this approach but unfortunately I think that the GroupSequenceProvider won't be suitable for what I need. As every field can change and the form has many fields that may not be grouped. I would need to provide a GroupSequence for every field in the form. There is also a requirement for a content editor to be able to dynamically update form fields and associate validation constraints per field so it maybe the case that hibernate validation is not a good fit for these requirements.
I think that I need to somehow do the following :
* For each field in a form enable a a CMS editor be able to associate constraints for example Field A - constraint 1 .. n (name and constraint stored in CMS)
* On form submission - Form processor gets all parameter names from the request and looks up the associated constraints to create a dynamic constraint map {(field a, (constraint1, constraint 2)), (field b, (constraint 1, constraint 3 ) ...}
* Form parameters are bound to a bean which is then validated against the constraint map.
Regards
|