Does Spring Boot automatically resolve message keys in javax and hibernate validation annotations

回眸只為那壹抹淺笑 提交于 2019-12-05 11:51:32
Miloš Milivojević

Are your messages in the correct place? Spring Boot automatically registers a MessageSource bean for you, so you should put your messages in the src/main/resources/messages.properties file. If you have enabled the auto-configuration and also have hibernate-validator dependency on the classpath, everything should work out of the box.

Also @PropertySource is related to application's configuration properties and not messages so the fact that it's not resolving them is to be expected ^^

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!