0

I'm experiencing a strange problem in Spring Webflow 2: I have three states inside my flow: 1) form to fill 2) confirmation page 3) action-state to save the model

The first state works perfectly, no problem The second state does not reply to any submit button. totally dead, no reaction at all either client side as server side. Do you have any ideas why?

here my flow definition:

<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> 

And here the second step .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>

thanks a lot

MarcoAbi
  • 61
  • 1
  • 6

1 Answers1

0

I would like to see how you declare the form... anyway, check if the action and method attributes has been added to the form tag. For example:

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

or in your case:

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

Hope this helps.

txedo
  • 956
  • 11
  • 11