【问题标题】:spring web flow enable scopesspring web flow 启用范围
【发布时间】:2014-11-19 09:15:53
【问题描述】:

Spring Web Flow 提供了额外的 bean 范围,例如 flow、conversation、flash 等。我可以使用 var 在 flow.xml 中定义流范围 bean,或者我可以将值设置为新的范围变量。我如何在 spring 应用程序上下文 xml 文件中定义它。我尝试使用这种模式:

<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 中启用它

【问题讨论】:

    标签: spring scope spring-webflow spring-webflow-2


    【解决方案1】:

    尝试在您的应用程序上下文中定义它:

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

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-03-20
      • 1970-01-01
      • 1970-01-01
      • 2012-06-15
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多