Spring Web Flow + Thymeleaf

我想使用Spring Web Flow和Thymeleaf,以前使用Spring MVC进行配置。 它的工作原理,但我得到“org.springframework.webflow.definition.registry.NoSuchFlowDefinitionException”在每一页上。 我想在某些页面上使用SWF,并保持原来的状态 - 由没有流量的控制器处理。 可能吗?

这是我的视图配置:

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:oxm="http://www.springframework.org/schema/oxm"
xmlns:webflow="http://www.springframework.org/schema/webflow-config"
xsi:schemaLocation="http://www.springframework.org/schema/oxm
     http://www.springframework.org/schema/oxm/spring-oxm.xsd
     http://www.springframework.org/schema/webflow-config
     http://www.springframework.org/schema/webflow-config/spring-webflow-config-2.3.xsd
     http://www.springframework.org/schema/beans
     http://www.springframework.org/schema/beans/spring-beans.xsd">



<bean id="templateResolver"
    class="org.thymeleaf.templateresolver.ServletContextTemplateResolver">
    <property name="prefix" value="/WEB-INF/thymeleaf/" />
    <property name="suffix" value=".html" />
    <property name="templateMode" value="HTML5" />
    <!-- Template cache is set to false (default is true). -->
    <property name="cacheable" value="false" />
</bean>

<bean id="templateEngine" class="org.thymeleaf.spring4.SpringTemplateEngine">
    <property name="templateResolver" ref="templateResolver" />
    <property name="additionalDialects">
        <set>
            <bean class="org.thymeleaf.extras.springsecurity3.dialect.SpringSecurityDialect" />
        </set>
    </property>
</bean>
<webflow:flow-executor id="flowExecutor"></webflow:flow-executor>

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

<webflow:flow-registry id="flowRegistry"
    flow-builder-services="flowBuilderServices">
    <webflow:flow-location-pattern value="/**/*-flow.xml" />
</webflow:flow-registry>


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

<bean
    class="org.springframework.web.servlet.view.ContentNegotiatingViewResolver">
    <property name="contentNegotiationManager" ref="cnManager" />

    <property name="viewResolvers">
        <list>

            <bean class="org.springframework.web.servlet.view.BeanNameViewResolver">
                <property name="order" value="1" />
            </bean>
            <bean id="thymeleafViewResolver" class="org.thymeleaf.spring4.view.AjaxThymeleafViewResolver">
                <property name="viewClass"
                    value="org.thymeleaf.spring4.view.FlowAjaxThymeleafView" />
                <property name="templateEngine" ref="templateEngine" />
                <property name="order" value="2" />
            </bean>
        </list>
    </property>
</bean>

<bean id="mvcViewFactoryCreator"
    class="org.springframework.webflow.mvc.builder.MvcViewFactoryCreator">
    <property name="viewResolvers" ref="thymeleafViewResolver" />
</bean>

<bean id="thymeleafViewResolver" class="org.thymeleaf.spring4.view.AjaxThymeleafViewResolver">
    <property name="viewClass"
        value="org.thymeleaf.spring4.view.FlowAjaxThymeleafView" />
    <property name="templateEngine" ref="templateEngine" />
</bean>

<!-- Simple strategy: only path extension is taken into account -->
<bean id="cnManager"
    class="org.springframework.web.accept.ContentNegotiationManagerFactoryBean">
    <property name="favorPathExtension" value="true" />
    <property name="ignoreAcceptHeader" value="true" />
    <property name="defaultContentType" value="text/html" />

    <property name="mediaTypes">
        <map>
            <entry key="html" value="text/html" />
            <entry key="xml" value="application/xml" />
            <entry key="atom" value="application/atom+xml" />
        </map>
    </property>
</bean>

链接地址: http://www.djcxy.com/p/39103.html

上一篇: Spring Web Flow + Thymeleaf

下一篇: Web flow add model attribute for binding with form values