2013-02-13 17 views
1

我嘗試添加的reCAPTCHA在Roo的生成XHTML顯示:Spring Roo的JSF:驗證碼未在對話框

<p:dialog id="createDialog" header="#{messages.label_create} Person" modal="true" widgetVar="createDialogWidget" dynamic="true" visible="#{personBean.createDialogVisible}" resizable="true" maximizable="true" showEffect="fade" hideEffect="explode"> 
    <p:ajax event="close" update=":dataForm:data" listener="#{personBean.handleDialogClose}" /> 
    <p:outputPanel id="createPanel"> 
    <h:form id="createForm" enctype="multipart/form-data"> 
     <h:panelGrid id="createPanelGrid" columns="3" binding="#{personBean.createPanelGrid}" styleClass="dialog" columnClasses="col1,col2,col3" /> 

     <p:captcha id="createReCaptcha" theme="white"/> 

     <p:commandButton id="createSaveButton" value="#{messages.label_save}" action="#{personBean.persist}" update="createPanelGrid :growlForm:growl" /> 
     <p:commandButton id="createCloseButton" value="#{messages.label_close}" onclick="createDialogWidget.hide()" type="button" /> 
    </h:form> 
    </p:outputPanel> 
</p:dialog> 

而且沒有recaptha顯示....我哪裏錯了?

+0

確實有任何錯誤嗎?你有沒有定義PUBLIC_CAPTCHA_KEY – roel 2013-02-13 15:45:54

+0

沒有錯誤,但當我按「保存」有一個錯誤,像「錯誤jdt_26:...」,我認爲關於驗證碼是無效的。是的,我的公鑰和私鑰在web.xml中定義。 但我還沒有在服務器端pojo中定義任何驗證碼處理,也許這裏的問題? – Dmitry 2013-02-14 10:45:28

+0

當你將你的驗證碼放到p:對話框的外面時它會工作嗎? p:對話往往是* ss中的一個痛點。 – roel 2013-02-14 13:51:56

回答

1

從p:對話框中刪除dynamic =「true」

+0

它的工作,非常感謝!不幸的是,由於我的聲譽很低,無法「投票」...... – Dmitry 2013-02-15 12:32:16