java – Spring webflow PropertyNotFoundException:找不到属性
作者:互联网
我试图在spring webflow xml定义中设置会话范围内的变量,并且找不到找到的属性.请帮助
118484 [http-8080-6] DEBUG servlet.YBRServlet – Handler execution
resulted in exception – forwarding to resolved error view:
ModelAndView: reference to view with name ‘Err010DfltCrtc’; model is
{exception=org.springframework.webflow.execution.ActionExecutionException:
Exception thrown executing [AnnotatedAction@87ba9e targetAction =
[SetAction@1ed364c name =
flowRequestContext.externalContext.sessionMap.testCompleted, value =
yes], attributes = map[[empty]]] in state ‘AnnIncr’ of flow
‘QlfyEnrl’ — action execution attributes were ‘map[[empty]]’}
org.springframework.webflow.execution.ActionExecutionException:
Exception thrown executing [AnnotatedAction@87ba9e targetAction =
[SetAction@1ed364c name =
flowRequestContext.externalContext.sessionMap.testCompleted, value =
yes], attributes = map[[empty]]] in state ‘AnnIncr’ of flow
‘QlfyEnrl’ — action execution attributes were ‘map[[empty]]’ at
org.springframework.webflow.execution.ActionExecutor.execute(ActionExecutor.java:60)
at
org.springframework.webflow.engine.ActionList.execute(ActionList.java:155)
at org.springframework.webflow.engine.State.enter(State.java:193) at
org.springframework.webflow.engine.Transition.execute(Transition.java:227)
at
org.springframework.webflow.engine.DecisionState.doEnter(DecisionState.java:51)
Caused by:
org.springframework.binding.expression.PropertyNotFoundException:
Property not found at
org.springframework.binding.expression.spel.SpringELExpression.getValue(SpringELExpression.java:87)
atorg.springframework.expression.spel.SpelEvaluationException:
EL1008E*:(pos 0): Field or property ‘yes’ cannot be found on object of*
type
‘org.springframework.webflow.engine.impl.RequestControlContextImpl’
at
org.springframework.expression.spel.ast.PropertyOrFieldReference.readProperty(PropertyOrFieldReference.java:180)
at
org.springframework.expression.spel.ast.PropertyOrFieldReference.getValueInternal(PropertyOrFieldReference.java:60)
at
org.springframework.expression.spel.ast.SpelNodeImpl.getTypedValue(SpelNodeImpl.java:102)
at
org.springframework.expression.spel.standard.SpelExpression.getValue(SpelExpression.java:97)
at
org.springframework.binding.expression.spel.SpringELExpression.getValue(SpringELExpression.java:84)
… 88 more
流程代码
<view-state id="AnnIncr" view="AnnIncr" model="ssModel">
<on-entry>
<set name="flowRequestContext.externalContext.sessionMap.testCompleted" value="yes"></set>
</on-entry>
.....
<on-exit>
<set name="flowRequestContext.externalContext.sessionMap.testCompleted" value="no"></set>
</on-exit>
</view-state>
解决方法:
我发现了问题,在双引号中我必须用单引号将值包装起来将其表示为一个值,否则它会在这里表达一个表达式.
<set name="flowRequestContext.externalContext.sessionMap.testCompleted" value="yes"></set>
它应该是
<set name="flowRequestContext.externalContext.sessionMap.testCompleted" value="'yes'"></set>
标签:java,spring-webflow 来源: https://codeday.me/bug/20190729/1572991.html