【发布时间】:2018-03-29 14:32:32
【问题描述】:
我正在使用 Spring WebFlow 2.5.0,但我的 SpEL 表达式没有被正确评估。我想我的 WebFlow 配置或 SpEL 一定有问题,但我不确定是哪个。
我的 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>
但是,即使我的 respondToChallenge() 方法返回 Event.success(),我也永远不会转换到 loginComplete 状态。测试似乎总是评估为 FALSE。
是我的 SpEL 有误,还是我进行评估/测试的方式有误?如何调试 SpEL 评估以查看发生了什么?
我尝试将调试点放在org.springframework.binding.expression.spel.SpringELExpression 类中,但是当我尝试在执行getValue()/etc 时跟踪逻辑时,我有点迷失了。我所能看到的是它始终评估为假。
【问题讨论】:
标签: spring spring-webflow spring-el