Custom validation message for bean validation

柔情痞子 提交于 2019-12-06 02:50:47

I've also created a file 'ValidationMessages.properties' in WEB-INF/classes (I'm using Netbeans 7.0.1)

I understand that you've put it straight in the project's /WEB-INF/classes folder yourself? This will likely be ignored/overridden if you let your IDE build/deploy the WAR (at least, this is true for Eclipse). You should rather put that file straight in the root of the Java source folder of the project. You can verify yourself if it really ended up in /WEB-INF/classes, after you export the project to a WAR file and then extract it using some ZIP tool.

I placed the .properties file in the resources folder and it worked, there was no need to register the file anywhere. For the record: I'm using Netbeans 7.0.1 and Maven.

Thanks for the help, BalusC!

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