是的,这是可能的。仔细阅读该版本的 Spring 文档。您将需要使用 1.0.X 和 2.3.X 的参考文档,因为这会有所帮助。请特别注意升级指南建议的以下更改。
第 1 步。我编写了一个小工具来扩展下面的升级程序,以递归地查找我们所有的 Web 流并将标签转换为 2.3.X 兼容:
java org.springframework.webflow.upgrade.WebFlowUpgrader flow-to-upgrade.xml
这个类可以在 WebFlow jars 源代码中找到。
第 2 步。我更新了架构:
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:webflow="http://www.springframework.org/schema/webflow-config"
xsi:schemaLocation="
http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
http://www.springframework.org/schema/webflow-config
http://www.springframework.org/schema/webflow-config/spring-webflow-config-2.3.xsd">
步骤 3. 确认 flowExecutor 标签已更新为 2.3 合规性:
<webflow:flow-executor id="flowExecutor" />
步骤 4. 更新基于静态路径的声明的 flowRegistry 并确保标签合规性:
<webflow:flow-registry id="flowRegistry">
<webflow:flow-location path="/WEB-INF/hotels/booking/booking.xml" />
</webflow:flow-registry>
第 5 步。更改 FlowController 类以匹配新的 Web Flow jar:
从org.springframework.webflow.executor.mvc.FlowController 更改为现在org.springframework.webflow.mvc.servlet.FlowController
步骤 6. 更新 FlowController bean 类引用。添加 WebFlow1FlowUrlHandler 确保 Web Flow 1.0.x 流将运行并与新的 Web Flow 2 jar 向后兼容。
<bean name="/pos.htm" class="org.springframework.webflow.mvc.servlet.FlowController">
<property name="flowExecutor" ref="flowExecutor" />
<property name="flowUrlHandler">
<bean class="org.springframework.webflow.context.servlet.WebFlow1FlowUrlHandler" />
</property>
</bean>
http://docs.spring.io/spring-webflow/docs/2.3.x/reference/htmlsingle/#upgrade-guide
http://static.springsource.org/spring-webflow/docs/1.0.1/reference/index.html