How to match cross-field bean validation errors to a single h:message?

回眸只為那壹抹淺笑 提交于 2019-12-08 08:59:48

问题


We're currently building a web application based on JSF and PrimeFaces and want to use Bean Validation to validate the domain model. The problem we currently face is that we want most error messages displayed next to a single input field. For example, suppose there's a constraint "enddate > startdate", implemented as a class-level bean validator, we still want constraint violations for that rule to show up in a h:message/p:message specific to the enddate field rather than in the globalOnly section. Can this be achieved? If so, how?

来源:https://stackoverflow.com/questions/20740685/how-to-match-cross-field-bean-validation-errors-to-a-single-hmessage

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