开发者

How to use PrimeFaces Captcha?

开发者 https://www.devze.com 2023-04-08 19:56 出处:网络
I went thr开发者_开发技巧ough 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 b

I went thr开发者_开发技巧ough 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?


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/)

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号