What's the most AGILE APPROACH to validate Spring-MVC command (speeds up validation implementation on server side)? (Spring-MVC)?

"YOU AND THE ART OF ONLINE DATING" is the only product on the market that will take you step-by-step through the process of online dating, provide you with the resources to help ensure success. Get it now!

Agile" means different things to different people :-) That said, bernate Validator is very convenient if you're using bernate as ORM because it allows you to specify your constraints ONCE and have (some of) them propagated to database, work in your business layer and work in your UI layer. Additionally, 4.0 beta implements JSR 303 which most likely will be the standard approach to validation going forward Validator 3.1 does have certain issues with automatically validating constraints within collections of elements, but it's reasonably easy to patch and / or work around (been there, done that, works perfectly now). Haven't migrated to 4.0 beta yet, so I don't know whether that was fixed It's definitely extensible - you can easily write your own constraints.

Agile" means different things to different people :-) That said, bernate Validator is very convenient if you're using bernate as ORM because it allows you to specify your constraints ONCE and have (some of) them propagated to database, work in your business layer and work in your UI layer. Additionally, 4.0 beta implements JSR 303 which most likely will be the standard approach to validation going forward. Validator 3.1 does have certain issues with automatically validating constraints within collections of elements, but it's reasonably easy to patch and / or work around (been there, done that, works perfectly now).

Haven't migrated to 4.0 beta yet, so I don't know whether that was fixed. It's definitely extensible - you can easily write your own constraints.

Regards – Arthur Ronald F D Garcia Aug 8 '09 at 16:38 2 I use it in conjunction with Spring, not just in UI layer (which is based on Spring MVC) but throughout the entire system. DB schema is generated based on Validator annotations (e.g. Column length for text fields is derived from @Length instead of being set via @Column), business layer entities are using the very same constraints, UI decorators (where applicable) are annotated with them as well. Works great.

I have a few custom validators too. – ChssPly76 Aug 8 '09 at 21:29 A good introduction is found here: sleberknight. Com/blog/sleberkn/entry/20070910 Six in-depth articles about – Arthur Ronald F D Garcia Aug 11 '09 at 22:32.

You are able to enter the Validation logic yourself. How hard is this? Public void validate(Object target, Errors errors) { ValidationUtils.

RejectIfEmptyOrWhitespace(errors, "email", "error.blank. Email", "Email address is required."); ValidationUtils. RejectIfEmptyOrWhitespace(errors, "name", "error.blank.

Name", "Name is required"); ValidationUtils. RejectIfEmptyOrWhitespace(errors, "phone", "error.blank. Phone", "Phone is required"); ValidationUtils.

RejectIfEmptyOrWhitespace(errors, "question", "error.blank. Question", "Question is required"); } Very agile!

3 If you look at the code in your sample, you'll notice that the only difference between those 4 ValidationUtils calls is the field name and it's repeated twice (three times counting the message, but that should be localized anyway). Using bernate Validator you'd just annotate the appropriate getters in your bean with @NotEmpty - and you're done. I believe that's what OP meant by "agile".

Note that I don't have anything against Spring Validator. – ChssPly76 Aug 7 '09 at 20:19.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions