春季:无法获取模型此流程

问题描述 投票:0回答:1

我已经写了春天的web流量在我project.When我打流它显示一个错误

Caused by:org.springframework.webflow.engine.model.builder.FlowModelBuilderException : Could not access the XML flow definition at ServletContext resource /WEB-INF/webapp/xxx-webflow.xml

我得到上面的错误,并显示当我试图访问我的流程,找到我的参考下面的代码为无法获取其型号为这种流动。

    <webflow:flow-executor id="flowExecutor" />

    <webflow:flow-registry id="flowRegistry"
        flow-builder-services="flowBuilderServices" base-path="/WEB-INF">
        <!-- here the id is mapped to invoke this flow -->
        <webflow:flow-location id="forgotPasswordFlow" path="/webapp/xxx-webflow.xml" />
    </webflow:flow-registry>

    <webflow:flow-builder-services id="flowBuilderServices"
        view-factory-creator="viewFactoryCreator" />

    <bean id="viewFactoryCreator"
        class="org.springframework.webflow.mvc.builder.MvcViewFactoryCreator">
        <property name="viewResolvers">
            <list>
                <ref bean="viewResolver" />
            </list>
        </property>
    </bean>

    <bean id="viewResolver"
        class="org.springframework.web.servlet.view.UrlBasedViewResolver">
        <property name="viewClass"
            value="org.springframework.web.servlet.view.JstlView" />
        <property name="prefix" value="/templates/" />
        <property name="suffix" value=".html" />
    </bean>

    <bean class="org.springframework.webflow.mvc.servlet.FlowHandlerAdapter"><property name="flowExecutor" ref="flowExecutor" />
    </bean>

    <bean class="org.springframework.webflow.mvc.servlet.FlowHandlerMapping">
        <property name="flowRegistry" ref="flowRegistry" />
        <property name="order" value="0" />
    </bean>


and my xxx.xml file is

<view-state id="viewForgotPasswordForm" view="/templates/casForgetPasswordView.html"
        model="forgotPasswordCredential">
        <binder>
            <binding property="userId" required="true" />
            <binding property="tenantId" required="true" />
        </binder>
        <transition on="submit" bind="true" validate="true"
            to="forgotPasswordWebflowInitialization" />
    </view-state>
spring spring-boot spring-webflow
1个回答
0
投票

你的配置似乎在寻找WEB-INF/webapp/xxx-webflow.xml。如果你的文件确实位于webapp/webflow/xxx--webflow.xml你应该使用以下配置:

<webflow:flow-registry id="flowRegistry"
    flow-builder-services="flowBuilderServices" base-path="/webflow">
    <!-- here the id is mapped to invoke this flow -->
    <webflow:flow-location id="forgotPasswordFlow" path="xxx-webflow.xml" />
</webflow:flow-registry>
© www.soinside.com 2019 - 2024. All rights reserved.