How to use PrimeFaces Captcha?

与世无争的帅哥 提交于 2019-12-07 09:42:39

问题


I went through the user guide and the showcase but couldn't find a way to get the Captcha evaluation result in the backing bean. I can see the result on the top message bar on the UI but how to get the result in the backing bean?


回答1:


I don't think that it has any result for your beans. If you type valid text in the captcha box the process validation phase does not throw error and your input will be handled as valid. Otherwise the captcha component signal the error and you will see the error message with the h:message or the h:messages tag. (Maybe you should attach some code.)

"If an entered value is invalid, an error message is added to FacesContext, and the component is marked invalid. If a component is marked invalid, JSF advances to the render response phase, which will display the current view with the validation error messages. If there are no validation errors, JSF advances to the update model values phase."

(From http://www.ibm.com/developerworks/library/j-jsf2/)



来源:https://stackoverflow.com/questions/7546542/how-to-use-primefaces-captcha

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