2012-03-31 92 views
1

我们有一个基于Spring 2.5.6和Webflow 2.3的大型网络应用程序。现在我们要将Spring升级到3并将Webflow升级到2.3。升级Spring非常简单,但是我们在其他库上有一些问题。更改版本后,我们甚至无法使用maven构建我们的应用程序。例如:包名称,方法可见性修饰符,甚至被删除的方法有很大的不同,我们在1.0.6中使用这些方法。 你现在有些指南,我们应该如何替换改变的方法?我在Spring网站上发现了类似的东西,但对我来说这不太有用。 也许有人这样做,可以给我们一些提示? 感谢您的帮助:)将Spring Webflow从1.0.6升级到2.3

+0

你试过问在春季论坛的Webflow? – 2012-03-31 09:01:45

回答

2

是的,这是可能的。仔细阅读Spring文档以了解发布。您将需要使用1.0.X & 2.3.X的参考文档,因为这会有所帮助。请特别注意升级指南推荐的以下更改。

第1步。我写了一个小工具,下方延伸升级程序以递归发现我们所有的网络流量和转化标签是符合2.3.x版本:

java org.springframework.webflow.upgrade.WebFlowUpgrader flow-to-upgrade.xml 

这个类是在一个Webflow发现罐子来源。

步骤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静态路径based声明并确保符合标签:

<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罐。

<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