2013-05-15 67 views
0

Spring web流程提供了額外的bean範圍,如流,會話,閃存等。我可以使用var在flow.xml中定義流範圍bean,或者我可以爲新的範圍變量設置值。我如何在spring應用程序上下文xml文件中定義它。我試圖用這個模式:Spring web flow enable範圍

<bean id="abc" class="abc" scope="flow"/>

我有錯誤,沒有範圍限定。我搜索谷歌和發現這個東西 http://blog.springsource.org/2007/05/08/spring-web-flow-bean-scopes-and-jsf/

,但不知道如何使它能夠在Spring Web Flow的2.3

回答

0

嘗試在你的應用程序上下文中定義它:

<bean class="org.springframework.beans.factory.config.CustomScopeConfigurer"> 
    <property name="scopes"> 
     <map> 
      <entry key="flow"> 
       <bean class="org.springframework.webflow.config.scope.FlowScope"/> 
      </entry> 
     </map> 
    </property> 
</bean>