Captcha is based on reCAPTCHA API.
<div class="card">
<h:form>
<p:messages showDetail="true"/>
<p:captcha label="Captcha"/>
<br/>
<p:commandButton value="Check" action="#{captchaView.submit}" ajax="false" icon="pi pi-check"/>
</h:form>
</div>
@Named
@RequestScoped
public class CaptchaView {
public void submit() {
FacesMessage msg = new FacesMessage(FacesMessage.SEVERITY_INFO, "Correct", "Correct");
FacesContext.getCurrentInstance().addMessage(null, msg);
}
}