我正在尝试在Liferay portlet中使用Primefaces验证码控件。
我有以下代码:
<h:form>
....
<p:captcha id="captcha" requiredMessage="Debe ingresar el captcha"/>
<p:commandButton value="Send" actionListener="#{registrationPymeViewEdit.onSend}" ajax="false" />
</h:form>
在我的web.xml中,我配置了这样的公钥和私钥:
<context-param>
<param-name>primefaces.PRIVATE_CAPTCHA_KEY</param-name>
<param-value>MY_PRIVATE_KEY</param-value>
</context-param>
<context-param>
<param-name>primefaces.PUBLIC_CAPTCHA_KEY</param-name>
<param-value>MY_PUBLIC_KEY</param-value>
</context-param>
我遇到的问题是表单没有被提交,它从不执行我的bean的“onSend”方法。如果我删除了验证码,那么bean的方法就可以执行了。
有什么想法吗?
提前致谢!
答案 0 :(得分:0)
我假设您的服务器日志没有任何错误。 尝试使用action而不是actionlistener和相应的操作方法。