需要在一个弹簧webflow视图状态下在dev环境中提交两次表单

时间:2014-06-21 06:53:39

标签: spring-webflow-2

在我们的开发环境中,我们有几个Webflow视图状态,在第一个按钮提交时,事件无法被识别(即使它被发布到服务器 - 通过HTTP Fox检查)。当我第二次在JSP上按下按钮时,事件确实被识别,处理工作正常。我们在8个流程中有大约40个事件(包括3个子流程),这只发生在一个子流程中的两个视图状态中!

现在在我们的外部测试环境中,这不会发生。但是,我想了解为什么它在我们的开发环境中出现

在测试中我们有Apache - WebLogic(但它可以直接用于weblogic)。这在Linux中运行

在开发中,我们使用war文件在IDE和WebLogic中使用Tomcat。两者都有这个问题。

我们已经扩展了FlowExecutionListenerAdapter以列出Web流引擎对提交的操作。在初始提交时,它确实获得了requestSubmitted但不是eventSignaled(这仅在第二次提交时发生)

Web Flow配置:          http://www.springframework.org/schema/webflow/spring-webflow-2.0.xsd">

<var name="primaryContact" class=".model.domain.contacts.PrimaryContact" />  
<var name="selectPrimaryContactAccounts" class="project.web.formBean.SelectPrimaryContactAccounts" />

<input name="subFlowInput" required="true"  type="project.web.formBean.contactManagement.SelectAccountsForPrimaryContactSubFlowInput" />

<on-start>
    <set name="primaryContact" value="subFlowInput.primaryContact"></set>
    <evaluate
            expression="selectAccountsForPrimaryContactSubFlowHandler.findPrimaryContactLU(subFlowInput.sacOrLEsearchState, subFlowInput.primaryContact)"
            result="flowScope.primaryContacts"/>   
    <evaluate
        expression="subFlowInput.sacOrLEsearchState.extractOwningCustomer()"
        result="flowScope.owningCustomerOrLegalEntityId" />
</on-start>

<view-state id="selectAccountsForm" view="agent.contactManagement.selectAccountsForPrimaryContact.selectAccounts" model="selectPrimaryContactAccounts">

    <on-render>
        <evaluate
                expression="selectAccountsForPrimaryContactSubFlowHandler.getAccountSystemReferenceData()"
                result="requestScope.accountSystems"/>

        <set name="flowScope.hasSearched" value="false" type="boolean" />
    </on-render>

    <transition on="searchSourceSystem" to="selectAccountsFormSourceSystemSearched" />

</view-state>

<view-state id="selectAccountsFormSourceSystemSearched" view="agent.contactManagement.selectAccountsForPrimaryContact.selectAccounts" model="selectPrimaryContactAccounts">
    <on-render>
        <evaluate
                expression="selectAccountsForPrimaryContactSubFlowHandler.getAccountSystemReferenceData()"
                result="requestScope.accountSystems"/>

        <evaluate expression="selectAccountsForPrimaryContactSubFlowHandler.findPrimaryContactAccountAssociationsForAccountSystem(primaryContact, selectPrimaryContactAccounts, owningCustomerOrLegalEntityId)"
                  result="requestScope.primaryContactAssociations"/>

        <set name="flowScope.hasSearched" value="true" type="boolean"/>
    </on-render>

    <transition on="save" to="accountsSelected"/>
</view-state>

<

<end-state id="accountsSelected" >
    <output name="selectPrimaryContactAccounts" value="selectPrimaryContactAccounts" type="project.web.formBean.SelectPrimaryContactAccounts" />
</end-state>

<end-state id="cancelSelection" />

<global-transitions>
    <transition on="back" to="cancelSelection">
    </transition>
</global-transitions>

</flow>

public class CdFlowExecutionListener扩展了FlowExecutionListenerAdapter {

    @Override`enter code here`
    public void stateEntered(RequestContext context, StateDefinition previousState, StateDefinition newState) {
         // log using in house framework
    }

    @Override
    public void eventSignaled(RequestContext context, Event event) {
        // log using in house framework
    }

    @Override
    public void requestSubmitted(RequestContext context) {
        // log using in house framework
    }

    @Override
    public void transitionExecuting(RequestContext context, TransitionDefinition transition) {
        // log using in house framework
    }

    @Override
    public void exceptionThrown(RequestContext context, FlowExecutionException exception) {
        // log using in house framework
    }
}

0 个答案:

没有答案