持久或更新期间用户友好的验证消息

发布于 2024-09-09 01:42:06 字数 325 浏览 2 评论 0原文

您能否建议有关用户界面中验证消息相关信息的良好实践。假设您有下表(用户、地址、电子邮件),并且我们使用 JPA 来建模我们的实体,并且底层验证提供程序是 Hibernate。

当值为空或不正确时抛出的默认消息是 validator.required=值是必需的 validator.notNull=may not null

提供用户友好的消息是理想的选择,例如。

在此输入您的密码 输入您的名字 输入城市名称 城市名称不能包含数字字符

已经执行此操作的网站上的任何建议或作为 hibernate 验证器 jar 的一部分提供的现有默认密钥的一组语法正确的示例消息将很有用。

Can you suggest good practices for information related to validation messages in the user interface. Assuming you have a the following tables (User, Address, Email) and we use JPA to model our entities and the underlying validation provider is Hibernate.

The default messages which are throws when a value is empty or incorrect is either
validator.required=value is required
validator.notNull=may not be null

It would be ideal to provide user friendly messages like.

Enter your password here
Enter your first name
Enter the city name
City name cannot contain numerical characters

Any suggestions on web sites which already do this or a set of grammatically correct sample messages for the exisiting default keys shipped as part of hibernate validator jar will be useful.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

中二柚 2024-09-16 01:42:06

我找到了此链接 来自 www.SmashingMagazine.com 的一篇关于错误消息、验证以及向网站用户提供反馈的其他方面的优秀文章。

I found this link from www.SmashingMagazine.com to be an excellent article on error messages, validation and other aspects of providing feedback to your site users.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文