SolutionGuidance / psm

Welcome to the Medicare/Medicaid Provider Enrollment Screening Portal
http://projectpsm.org/
Other
26 stars 20 forks source link

Use Spring annotations to find and initialize form validators #1058

Closed jasonaowen closed 5 years ago

jasonaowen commented 6 years ago

Spring initialization is used for more than just controllers, and the same simplifications we made for controllers can be made for our form validators, too. And, now that #1044 is merged, we are already telling Spring to scan these class files; all we need to do is add the @Component annotation to let Spring find them and configure them.

This is the last of the Spring annotation experiments I have; I looked briefly into similarly streamlining the JNDI components, but those are a bridge out of Spring and into Java EE, which behaves a bit differently. It might be worthwhile to reconsider that decision someday, but that's much bigger than these annotation changes, and is not worthwhile at the moment.


I tested this by:

and I saw the expected error on each form.