I would like to know if there is any way to partially validate an object.

For example, there is an update form responsible for updating just 3 out of 10 
form fields... for now I have implemented this using Validator by my own. 
Something like:

@IfInvalid(fields="myobj.field1, myobj.field2, myobj.field3", ...)

There is also a problem that Hibernate validator does not give a method capable 
of validating a single field either recursively or not so I implemented the 
following algo:

- split the field name ("myobj.field1")
- grab the field value for each but the last string
- for the last string: if the field has an @Valid, call hibernate validator 
validate method for the entire object pointed by this field, if it doesnt, its 
a simple property so call hibernate validator validate method on the previous 
class type and object using this specific field

I want to know if there was something already done in this way or if I should 
have created a simple class to model this form although I really wouldnt like 
to do so..

Guilherme Silveira

View the original post : 
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3944227#3944227

Reply to the post : 
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3944227


-------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
JBoss-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to