我正在研究从网络浏览器中提取电子邮件的j2ee6项目。 我有一个命令Button,在用户输入电子邮件号码后调用提取方法。提取完成后,将显示确认拨号并显示提取的电子邮件数。这是我的xhtml代码:
<h:form id="mainform">
<p:panel id="panelform" header="Email Extractor" >
<h:panelGrid id="formulaire" columns="2">
<h:panelGroup id="formblock" layout="block" >
<p:panelGrid columns="2">
<p:outputLabel for="Emailsnbr" value="Enter the emails'number:" />
<p:inputText id="Emailsnbr" type="number" requiredMessage="Emails number is required"
value="#{mailMB.number}" required="true" label="Emailsnbr">
</p:inputText>
</p:panelGrid>
</h:panelGroup>
</h:panelGrid>
<p:commandButton value="Extract" style="width: 12%;height: 100%" update="tableemails, :confirmPurchase, :confirmPurchaseTest, :mainform" id="extractbutton" ajax="true" widgetVar="ButtonExtract"
actionListener="#{mailMB.searchEmails()}"
icon="ui-icon-disk" styleClass="ui-priority-primary"
onstart="blockUIWidget1.show();" oncomplete=" blockUIWidget1.hide(); if (args && !args.validationFailed) freeMails();" />
<p:dialog widgetVar="blockUIWidget1" modal="true" closable="false" >
<h:panelGrid columns="2">
<p:graphicImage url="pictures/loading_bar.gif" width="264" height="34" alt="animated-loading-bar"/>
<h:outputText value="Please wait..." style="white-space: nowrap;"/>
</h:panelGrid>
</p:dialog>
</p:panel>
</h:form>
<p:confirmDialog closable="false" style="position: absolute; width: 50px; border-color: blue" id="confirmPurchaseTest" message="Your Database was successfully created. And contains #{mailMB.number} Emails "
appendToBody="true"
header="Get Emails List" severity="info" widgetVar="emailsList">
<h:form>
<p:commandButton id="getEmails" style="width: 30%;height: 100%" value="Get Emails" oncomplete="window.location.href = '/Hitonclick/emailsList.xhtml'" >
<f:event type="preRenderView" listener="#{mailMB.preRender}"/>
</p:commandButton>
<p:commandButton id="declineTest" style="width: 30%;height: 100%" value="Decline" onclick="deleteDialog.show();" />
</h:form>
如果输入一个小数字,每件事情都可以。但是如果我为例600输入一个大数字,则提取时间变长(这个逻辑没有问题)并且确认对话框上显示的数字为0,尽管当我从数据库中检查它们时成功提取了电子邮件。它与ajax有什么关系? 我怎样才能解决这个问题?