How to standardize and organize error messages with Hibernate Validator (running under Spring framework)
-
29-09-2019 - |
Question
I'm learning Hibernate Validator. I see that I can add an error message text to any annotation.
But this seems like a bad way to handle error messages. It would be cleaner to return an error message ID and look up the message text in some resource file like a Properties file.
In this way I can later extend to other languages by swapping out the particular resource file; and the error messages are organized into one coherent location.
What's the best approach here with Hibernate Validator?
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow