问题执行springwebflow流关联视图未呈现

时间:2019-05-16 09:34:39

标签: spring-boot spring-webflow

我对使用spring-boot + primefaces和spring-webflow开发的应用程序有疑问。从日志中可以看到流已被记录并执行,但是未呈现与流相关的视图.DispatcherServlet似乎进入了根上下文。

这是我的pom文件:

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
  <modelVersion>4.0.0</modelVersion>
  <groupId>it.forgroup</groupId>
  <artifactId>DpmPilot</artifactId>
  <version>0.0.1-SNAPSHOT</version>
  <packaging>war</packaging>

  <name>DpmPilot</name>
  <url>http://www.forgroup.it</url>

  <properties>
    <java.version>1.8</java.version>

    <maven.war.plugin>2.6</maven.war.plugin>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
    <java.version>1.8</java.version>
    <joinfaces.version>3.3.0-rc2</joinfaces.version>
    <spring.webflow.version>2.5.1.RELEASE</spring.webflow.version>
    <spring.boot.version>2.1.4.RELEASE</spring.boot.version>
    <primefaces.version>1.0.8</primefaces.version>
    <jstl.version>1.2</jstl.version>
    <mssql.jdbc.version>7.0.0.jre8</mssql.jdbc.version>
    <apache.poi.version>4.0.0</apache.poi.version>
    <itext.version>2.1.7</itext.version>
    <maven.compiler.version>3.8.0</maven.compiler.version>
  </properties>

    <dependencyManagement>
        <dependencies>
          <dependency>
            <groupId>org.joinfaces</groupId>
            <artifactId>joinfaces-dependencies</artifactId>
            <version>${joinfaces.version}</version>
            <type>pom</type>
            <scope>import</scope>
          </dependency>
        </dependencies>
    </dependencyManagement>


  <dependencies>

    <!-- B A S E  =========================================================================-->

    <dependency>
      <groupId>javax.enterprise</groupId>
      <artifactId>cdi-api</artifactId>
    </dependency>

    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <scope>test</scope>
    </dependency>

    <dependency>
          <groupId>javax.servlet</groupId>
          <artifactId>jstl</artifactId>
          <version>${jstl.version}</version>
    </dependency>

    <!--  P R I M E F A C E S =========================================================================-->
    <dependency>
      <groupId>org.joinfaces</groupId>
      <artifactId>primefaces-spring-boot-starter</artifactId>
    </dependency>

    <dependency>  
        <groupId>org.primefaces.extensions</groupId>  
        <artifactId>all-themes</artifactId>  
          <version>${primefaces.version}</version>
    </dependency>

    <!--  S P R I N G  B O O T  =========================================================================-->

    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter</artifactId>
        <version>${spring.boot.version}</version>
    </dependency>

    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-data-jpa</artifactId>
        <version>${spring.boot.version}</version>
    </dependency>

    <dependency>
         <groupId>org.springframework.boot</groupId>
         <artifactId>spring-boot-starter-security</artifactId>
         <version>${spring.boot.version}</version>
    </dependency>

    <dependency>
        <groupId>org.springframework.data</groupId>
        <artifactId>spring-data-jpa</artifactId>
        <version>${spring.boot.version}</version>
    </dependency>



    <!--  S P R I N G  W E B F L O W  =========================================================================-->
    <dependency>
        <groupId>org.springframework.webflow</groupId>
        <artifactId>spring-webflow</artifactId>
        <version>${spring.webflow.version}</version>
    </dependency>
    <dependency>
        <groupId>org.springframework.webflow</groupId>
        <artifactId>spring-faces</artifactId>
        <version>${spring.webflow.version}</version>
    </dependency>

    <!--  H I B E R N A T E   =========================================================================-->

    <dependency>
        <groupId>org.hibernate</groupId>
        <artifactId>hibernate-core</artifactId>
    </dependency>

    <dependency>
        <groupId>org.hibernate</groupId>
        <artifactId>hibernate-entitymanager</artifactId>
    </dependency>

    <dependency>
        <groupId>javax.transaction</groupId>
        <artifactId>javax.transaction-api</artifactId>
    </dependency>


    <!-- S Q L  D R I V E R =========================================================================-->
    <dependency>
        <groupId>com.microsoft.sqlserver</groupId>
        <artifactId>mssql-jdbc</artifactId>
        <version>${mssql.jdbc.version}</version>
    </dependency>

    <!-- A P A C H E  P O I (pdf export)  =========================================================================-->

    <dependency>
        <groupId>org.apache.poi</groupId>
        <artifactId>poi</artifactId>
        <version>${apache.poi.version}</version>
    </dependency>

        <dependency>
        <groupId>org.apache.poi</groupId>
        <artifactId>poi-ooxml</artifactId>
        <version>${apache.poi.version}</version>
    </dependency>

    <dependency>
       <groupId>com.lowagie</groupId>
       <artifactId>itext</artifactId>
       <version>${itext.version}</version>
    </dependency>

  </dependencies>

  <build>
    <plugins>
      <plugin>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-maven-plugin</artifactId>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-compiler-plugin</artifactId>
        <version>${maven.compiler.version}</version>
        <configuration>
          <source>${java.version}</source>
          <target>${java.version}</target>
        </configuration>
      </plugin>
      <plugin>
          <artifactId>maven-war-plugin</artifactId>
          <version>${maven.war.plugin}</version>
          <configuration>
            <failOnMissingWebXml>false</failOnMissingWebXml>
          </configuration>
        </plugin>
    </plugins>
  </build>

</project>

这是我的流程配置类

package it.forgroup.dpmpilot.webflow.config;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.faces.config.AbstractFacesFlowConfiguration;
import org.springframework.faces.webflow.FlowFacesContextLifecycleListener;
import org.springframework.faces.webflow.JsfFlowHandlerAdapter;
import org.springframework.webflow.definition.registry.FlowDefinitionRegistry;
import org.springframework.webflow.engine.builder.support.FlowBuilderServices;
import org.springframework.webflow.executor.FlowExecutor;
import org.springframework.webflow.mvc.servlet.FlowHandlerAdapter;
import org.springframework.webflow.mvc.servlet.FlowHandlerMapping;

import it.forgroup.dpmpilot.exception.ExceptionListener;

@Configuration
public class WebFlowConfig extends AbstractFacesFlowConfiguration {


    @Bean(name="a")
    public FlowDefinitionRegistry flowRegistry() {
        return getFlowDefinitionRegistryBuilder()
                .setBasePath("/flows")
                .addFlowLocationPattern("/**/*.xml")
                .setFlowBuilderServices(flowBuilderServices())
                .build();
    }

    @Bean(name="b")
    public FlowBuilderServices flowBuilderServices() {
        return getFlowBuilderServicesBuilder()
                .setDevelopmentMode(true)
                .build();
    }

    @Bean(name="c")
    public FlowExecutor flowExecutor(ExceptionListener allExceptionListener) {
        return getFlowExecutorBuilder(flowRegistry())
                .addFlowExecutionListener(new FlowFacesContextLifecycleListener())
                .addFlowExecutionListener(allExceptionListener)
                .setMaxFlowExecutionSnapshots(0)
                .build();
    }

    @Bean("d")
    public FlowHandlerMapping flowHandlerMapping() {
        FlowHandlerMapping handlerMapping = new FlowHandlerMapping();
        handlerMapping.setOrder(-1);
        handlerMapping.setFlowRegistry(flowRegistry());
        return handlerMapping;
    }

    @Bean("e")
    public FlowHandlerAdapter flowHandlerAdapter(@Autowired ExceptionListener allExceptionListener) {
        JsfFlowHandlerAdapter adapter = new JsfFlowHandlerAdapter();
        adapter.setFlowExecutor(flowExecutor(allExceptionListener));
        return adapter;
}

}

请我需要帮助。

0 个答案:

没有答案