1
votes

We are using spring core + struts (without spring MVC)

Also, we are using spring bean validator with hibernate validator feature for realize the design by contract pattern.

As you know, these validations must be turned of when you deploy your application.

How is it possible to turn off the spring validation is applicationContext.xml?

1
Why do you need to turn off validation during deployment? - Gunnar
The design by contract pattern is used to validate method calls and return values during development, this pattern is used to ease bug fixes during development phase. - Alireza Fattahi

1 Answers

0
votes

Method validation in Spring is enabled via configuring a MethodValidationPostProcessor. In case you want to turn off method validation in certain scenarios you need to make sure no such processor is configured, e.g. by configuring it via a bean profile which is not active in this scenario.

Method validation is not intended to be used only during development though, I'd recommend to have it enabled in production as well.