[SPR-11473] Missing documentation on how to set up JSR-303 method validation Created: 22/Feb/14  Updated: 15/Jan/19  Resolved: 28/Feb/14

Status: Closed
Project: Spring Framework
Component/s: [Documentation]
Affects Version/s: 4.0.2
Fix Version/s: 4.0.3

Type: Task Priority: Major
Reporter: Abhijit Sarkar Assignee: Juergen Hoeller
Resolution: Complete Votes: 0
Labels: bean-validation, jsr-303
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Reference URL: http://docs.spring.io/spring/docs/4.0.x/spring-framework-reference/html/validation.html
Days since last comment: 1 year, 11 weeks, 2 days ago
Last commented by a User: true
Last updater: Spring Issuemaster


The part of the reference manual that talks about integration with JSR-303 conveniently omits two things, without which BV does not kick in.

  1. A MethodValidationPostProcessor needs to be configured in addition to the LocalValidatorFactoryBean.
  2. The class to be validated must have a @Validated annotation on it else methods are NOT searched for inline constraint annotations.

This just caused me 6 hours of debugging and hair tearing where I did everything the doc said but BV would simply not kick in. I finally had to debug through the Spring source code to understand this. There got to be an easier way and I can't be the only one who had this problem.

Comment by Spring Issuemaster [ 14/Jan/19 ]

The Spring Framework has migrated to GitHub Issues. This issue corresponds to spring-projects/spring-framework#16098.

Generated at Thu Apr 02 04:12:18 UTC 2020 using Jira 7.13.8#713008-sha1:1606a5c1e7006e1ab135aac81f7a9566b2dbc3a6.