Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

大神,错误消息国际化和业务校验Xml化的建议 #4

Open
bizihangHN opened this issue Jun 13, 2018 · 1 comment
Open

大神,错误消息国际化和业务校验Xml化的建议 #4

bizihangHN opened this issue Jun 13, 2018 · 1 comment

Comments

@bizihangHN
Copy link

  1. 没有找到国际化的使用demo
    2.每次复制字段复制到呕吐,是否可以把业务校验Xml化。类似下面这个类,完全可以使用Xml的方式配置。
    image
@devefx
Copy link
Owner

devefx commented Aug 8, 2018

在Validation的同级包下创建文件 ValidationMessages.properties(默认使用同级目录的资源,自定义路径参考ValidationContext #setResourceBundleLocator

ValidationMessages_cn.properties

account.required=请填写手机号或邮箱

ZhihuLoginValidation.class

context.constraint("account", "{account.required}", new NotEmpty());

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants