2012-03-31 93 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