0

我对 spring webflow 变量的初始化有问题。我有两个流 xml,它们看起来相同,但是当打开其中一个时,spring 会抛出此异常。在流中有两种变量初始化:

<var name="bean" bean="beanName" scope="flow"  />

<set attribute="id" value="${'someId'}" scope="flow" />

这是例外:

Caused by: java.lang.IllegalArgumentException: Name must not be null
at org.springframework.util.Assert.notNull(Assert.java:112)
at org.springframework.util.ClassUtils.forName(ClassUtils.java:222)
at org.springframework.webflow.engine.builder.model.FlowModelFlowBuilder.toClass(FlowModelFlowBuilder.java:958)
at org.springframework.webflow.engine.builder.model.FlowModelFlowBuilder.parseFlowVariable(FlowModelFlowBuilder.java:389)
at org.springframework.webflow.engine.builder.model.FlowModelFlowBuilder.buildVariables(FlowModelFlowBuilder.java:172)
at org.springframework.webflow.engine.builder.FlowAssembler.directAssembly(FlowAssembler.java:103)
at org.springframework.webflow.engine.builder.FlowAssembler.assembleFlow(FlowAssembler.java:91)
at org.springframework.webflow.engine.builder.DefaultFlowHolder.assembleFlow(DefaultFlowHolder.java:109)
at org.springframework.webflow.engine.builder.DefaultFlowHolder.getFlowDefinition(DefaultFlowHolder.java:84)
at org.springframework.webflow.definition.registry.FlowDefinitionRegistryImpl.getFlowDefinition(FlowDefinitionRegistryImpl.java:61)
at org.springframework.webflow.executor.FlowExecutorImpl.launchExecution(FlowExecutorImpl.java:138)
at org.springframework.webflow.mvc.servlet.FlowHandlerAdapter.handle(FlowHandlerAdapter.java:193)
at com.exigen.base.ui.flow.DefaultFlowController.handleRequest(DefaultFlowController.java:56)
at org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter.handle(SimpleControllerHandlerAdapter.java:48)
at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:923)
at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:852)
at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:882)
... 82 more
4

2 回答 2

1

我不确定您要做什么,但是如果您想使用<var>元素,则需要名称和类属性。喜欢 <var name="myVar" class="com.example.var.MyVar"/>

另外,你不需要在 webflow 中定义 bean,你可以自动使用你 applicationContext 中定义的那些

于 2012-08-01T15:27:57.823 回答
0

我解决了问题。问题在于 webflow 方案版本不匹配。我的一个流 xml 使用 1.0,而系统使用 2.0。

于 2012-08-02T05:53:43.563 回答