4

I have spring 2.5 application and several pages in the flow work perfectly - they progress according to my flow.xml. The page that is "broken" has the submit in the form:

<input type="image" name="_eventId_submit" src="<c:url value="images/continue.png" />" />

the flow definition for this page looks correct:

<view-state id="coverages" view="tiles.coverages" model="rtrForm">
    <on-entry>
 ...
    </on-entry>
    <transition on="submit" to="policyVehicleDetailsDecisionForward">
        <evaluate expression="coverageFormAction.bindAndValidate" />
        <evaluate expression="coverageFormAction.evaluateCoverages(rtrForm)" />
    </transition>
</view-state>

I have debug statements in the mainFlowAction.evaluateCoverages(...) and I don't see this in the log file but I also don't see any exceptions - anyone know where to go from here? I've attached eclipse to Tomcat 6.0.33 to do remote debugging and I still don't see any exceptions coming across the wire...I'm stumped at this point and have no clue how to figure this out - any help or suggestions would be welcomed.

So I've taken this a few steps further and I've overriden the QuoteFormAction.bindAndValidate() method and sadly, I'm not seeing this method being invoked in the logs - so I'm assuming at this point that the form isn't even invoking that...I'm using the same pattern that I have for all of the pages that do work. I've abbreviated the form - maybe I'm overlooking something obvious:

<form id="rtrForm" action="/rtrSite/main.svc?execution=e1s5" method="post">
...
<select name="quoteForm.policyLevelCoverages.towing" class="violationType" id="TOWING"  validate="selectOneOption" req="">
...
<select name="quoteForm.vehicleLevelCoverages[0].rental" class="violationType" id="RENTAL"  validate="selectOneOption" req="">
...
<input type="image" name="_eventId_submit" src="images/continue.png" />
<input type="image" name="_eventId_save" src="images/save.png" value='Save -n- Return' />
<input type="image" src="images/back.png" name="_eventId_back" value='Back' />
<input type="reset" id="reset" />
</form>

JSP Form generation:

<c:forEach var="policyCoverageList" varStatus="policyCoverageStatus" items="${quoteForm.coverages.jspCoverageCodesPolLevel}">

          <spring:bind path="quoteForm.policyLevelCoverages.${fn:toLowerCase(policyCoverageList.coverageCode)}" >
           <select name="${status.expression}" class="violationType" id="${policyCoverageList.coverageCode}"  validate="selectOneOption" req="">
                <c:if test="${policyCoverageList.isRequired == 'N'}">
                   <option value="-1"><spring:message code="coverage.decline" /></option>
                 </c:if>
                 <c:forEach var="policyCoverage" items="${policyCoverageList.limits}">
                     <option value="${policyCoverage.id}" <c:if test="${policyCoverage == 'TODO'}">SELECTED</c:if>>
                          ${policyCoverage.coverageLimits}
                      </option>
                  </c:forEach>
              </select>
           </spring:bind>

</c:forEach>
Jerry Skidmore
  • 400
  • 2
  • 7
  • 20

2 Answers2

4

In the logger turn the debuglevel on

<logger
        name="org.springframework.webflow">
        <level value="debug" />
    </logger>

You will see the messages on console/log file which will help you figure out the problem

vsingh
  • 6,365
  • 3
  • 53
  • 57
0

Is it returning back to the "tiles.coverages" view every time? If it is, I would assume you are having some kind of binding/validation errors. In the jsp put in <form:errors path="*"/> to see if that's true.

Edit:

Are both those two selects non-null and the second not empty? So for

quoteForm.vehicleLevelCoverages[0].rental

There is at least one element in the vehicleLevelCoverages list/array?

One side not:

Are you using Spring Weblflow 2? If you are you dont need to do bindAndValidate it does it for you anyway.

John Vint
  • 39,695
  • 7
  • 78
  • 108
  • I did verify that I have the form:errors and it does return to the tiles.coverages page. I just quickly overrode the bindAndValidate method in my CoveragesFormAction to log any Exceptions and none show up...would this just silently fail? – Jerry Skidmore Apr 05 '12 at 03:24
  • No they wouldn't just fail, it would propagate to the servlet container. Do you know which form errors you are getting? Are you by chance binding a `Date`? – John Vint Apr 05 '12 at 03:36
  • I just double checked and there is at least one element in the list at bind time. I am using webflow 2.5 - are you saying in the flow.xml I don't have to explicitly call bindAndValidate? (it doesn't hurt to do so does it?) – Jerry Skidmore Apr 05 '12 at 03:59
  • I am not sure if it would help or hurt but there are two attributes in the view-state element `bind=true/false` and `validate=true/false` So it will be doing it twice anyway. However if you wanted to transition from one state to another without validating you need to declare `validate=false` – John Vint Apr 05 '12 at 04:03
  • What I would try next is to remove each of the elements there one at a time to see if either of them are causing the binding to fail. – John Vint Apr 05 '12 at 04:04
  • I took everything off the page and now when I submit it actually progresses...so now I know for sure it's a bind/validate issue but there is nothing in the logs - I'm using apache commons with slf4j... – Jerry Skidmore Apr 05 '12 at 04:35
  • With the logging you probably don't have it either configured correctly or at the right level. For this try to put on form element in at a time and see which one it fails on. – John Vint Apr 05 '12 at 04:39
  • I'll have to give that a shot tomorrow - it's getting late and I haven't satisfied my halo reach addiction yet;-) Anyways, I accepted your answer as it was correct, now I will just have to one by one add them back on - I suspect it's because I'm programatically generating them (it's vehicle coverages which differ by state, so the VO that holds them has an entry for every possible coverage for every single state but the jsp has something like my new edit above – Jerry Skidmore Apr 05 '12 at 04:48
  • Thanks, glad I was able to point you in the right direction! Post again later if you have any questions/comments, good luck! – John Vint Apr 05 '12 at 04:56