1
votes

I'm using Spring WebFlow 2.5.0, but my SpEL expression is not being evaluated correctly. I figure I must be doing something wrong with either my WebFlow config or SpEL, however I'm not sure which.

I've got the following decision state in my login-flow.xml:

<decision-state id="submitChallenge">
    <on-entry>
        <evaluate expression="authenticationService.respondToChallenge(externalContext.nativeRequest, authRequest)"  result="flowScope.challengeName" result-type="org.springframework.webflow.execution.Event"/>
    </on-entry>
    <if test="flowScope.challengeName == 'success'" then="loginComplete" else="answerChallenge"/>
</decision-state>

However, even if my respondToChallenge() method returns an Event.success(), I am never transitioned to the loginComplete state. The test always seems to evaluate to FALSE.

Is it my SpEL which is wrong, or the way I'm doing my evaluation/test? How can I debug the SpEL evaluation to see what is happening?

I've tried to put debug points in the org.springframework.binding.expression.spel.SpringELExpression class but I'm kind of lost when I try to trace through the logic when executing a getValue()/etc. All I can see is that it consistently evaluates to false.

1

1 Answers

1
votes

After stepping through more carefully with the debugger, I saw that my flowScope.challengeName was of a different type than success. And hence Spring was returning false on the expression evaluation since they were of different types.