【问题标题】:spring webflow2 - no reaction after submitspring webflow2 - 提交后没有反应
【发布时间】:2012-06-06 23:45:47
【问题描述】:

我在 Spring Webflow 2 中遇到了一个奇怪的问题: 我的流程中有三个状态: 1) 填写表格 2) 确认页面 3) 保存模型的动作状态

第一个状态完美运行,没问题 第二种状态不回复任何提交按钮。完全死了,客户端和服务器端都没有反应。 你有什么想法吗?

这里是我的流程定义:

<view-state id="step1" view="profile/step1_profile" model="profile">
<on-render>
    <evaluate expression="profileReferenceData.getNationalities(flowRequestContext)"/>
    <evaluate expression="profileReferenceData.getRaces(flowRequestContext)"/>
    <evaluate expression="profileReferenceData.getReligions(flowRequestContext)"/>
</on-render>
    <transition on="submit_step_1" to="step2">
    </transition>
</view-state>

<view-state id="step2" view="profile/step2_confirmData" model="profile">
    <!--            <secured attributes="ROLE_USER" /> -->
    <transition on="submit_step_2" to="step3"/>
    <transition on="review" to="step1" />
</view-state>

<!--  step3. Save data  -->
 <action-state id="step3"> 
     <evaluate expression="profileServiceImpl.createProfileForWebFlow(profile)" /> 
     <transition on="ok" to="done" /> 
     <transition on="error" to="notDone" /> 
 </action-state> 

这里是第二步.jsp

<tr>
    <td><spring:message code="label.nationality"/>:</td>
    <td><c:out value="${profile.personalData.nationality}"/></td>
</tr>   
<tr>
    <td><spring:message code="label.race"/>:</td>
    <td><c:out value="${profile.personalData.race}"/>
</tr>   
<tr>
    <td><spring:message code="label.religion"/>:</td>
    <td><c:out value="${profile.personalData.religion}"/>
<tr>
    <td><input type="submit" value="Submit" name="_eventId_submit_step_2" /></td>
    <td><input type="submit" name="_eventId_review" value="Review"/></td>
    <td><input type="submit" name="_eventId_cancel" value="Cancel"/></td>
</tr>

非常感谢

【问题讨论】:

    标签: spring-webflow-2


    【解决方案1】:

    我想看看你是如何声明表单的...无论如何,请检查是否已将操作和方法属性添加到表单标记中。例如:

    <form id="formId" action="${flowExecutionUrl}" method="post">
    ...
    </form>
    

    或者在你的情况下:

    <form:form id="formId" action="${flowExecutionUrl}" method="post" modelAttribute="profile">
    ...
    </form:form>
    

    希望这会有所帮助。

    【讨论】:

      猜你喜欢
      • 2012-08-30
      • 1970-01-01
      • 2012-05-07
      • 2012-08-09
      • 1970-01-01
      • 1970-01-01
      • 2021-04-02
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多