2014-09-15 2 views
1

현재 스프링 MVC 4.0.5를 사용하고 있으며 일부 프로세스 지향적 인 페이지에 스프링 웹 플로우를 사용하고자합니다. 그러나 내 구성에는 여전히 문제가 있다고 생각합니다. 서버 로그에서스프링 웹 플로우 및 스프링 MVC URL 404

: 그것을 액세스 할 때 그러나

2014-09-15 20:54:49,280 [localhost-startStop-1] DEBUG org.springframework.webflow.definition.registry.FlowDefinitionRegistryImpl - Registering flow definition 'ServletContext resource [/WEB-INF/flows/registration/registration-flow.xml]' under id 'registration' 

, 로그는

여기
2014-09-15 20:54:49,820 [http-bio-8080-exec-2] DEBUG org.springframework.webflow.mvc.servlet.FlowHandlerMapping - No flow mapping found for request with URI '/appContext/registration/' 

웹에 대한 내 구성이

@Configuration 
public class WebFlowConfig extends AbstractFlowConfiguration { 

private Logger logger = Logger.getLogger(WebFlowConfig.class); 

@Bean 
@Autowired 
public FlowExecutor flowExecutor(FlowDefinitionRegistry flowRegistry, 
     PlatformTransactionManager txManager, SessionFactory sessionFactory) { 
    return getFlowExecutorBuilder(flowRegistry) 
      .addFlowExecutionListener(new SecurityFlowExecutionListener(), 
        "*") 
      .addFlowExecutionListener(
        new HibernateFlowExecutionListener(sessionFactory, 
          txManager), "*").build(); 
} 

@Bean 
@Autowired 
public FlowDefinitionRegistry flowRegistry(
     FlowBuilderServices flowBuilderServices) { 
    return getFlowDefinitionRegistryBuilder(flowBuilderServices) 
      .setBasePath("/WEB-INF/flows") 
      .addFlowLocationPattern("/**/*-flow.xml").build(); 
} 

@Bean 
@Autowired 
public FlowBuilderServices flowBuilderServices(
     MvcViewFactoryCreator mvcViewFactoryCreator, Validator validator) { 
    return getFlowBuilderServicesBuilder() 
      .setViewFactoryCreator(mvcViewFactoryCreator) 
      .setValidator(validator).setDevelopmentMode(true).build(); 
} 

@Bean 
@Autowired 
public MvcViewFactoryCreator mvcViewFactoryCreator(
     InternalResourceViewResolver viewResolver) { 
    MvcViewFactoryCreator factoryCreator = new MvcViewFactoryCreator(); 
    factoryCreator.setViewResolvers(Arrays.asList(viewResolver)); 
    return factoryCreator; 
} 

@Bean 
@Autowired 
public FlowHandlerMapping flowHandlerMapping(FlowDefinitionRegistry registry) { 
    FlowHandlerMapping handlerMapping = new FlowHandlerMapping(); 
    handlerMapping.setOrder(-1); 
    handlerMapping.setFlowRegistry(registry); 
    return handlerMapping; 
} 

@Bean 
@Autowired 
public FlowHandlerAdapter flowHandlerAdapter(FlowExecutor executor) { 
    FlowHandlerAdapter handlerAdapter = new FlowHandlerAdapter(); 
    handlerAdapter.setFlowExecutor(executor); 
    handlerAdapter.setSaveOutputToFlashScopeOnRedirect(true); 
    return handlerAdapter; 
} 
} 

희망 그 흐름을 말합니다 사람 도울 수있다. 감사.

답변

0

당신은 webflow 설정에 FlowHandlerMapping을 지정하는 : 스프링 웹 플로우에 대한

Implementation of HandlerMapping that follows a simple convention 
    for creating URL path mappings from the ids of registered flow definitions. This 
    implementation returns a FlowHandler that invokes a flow if the current request 
    path matches the id of a flow in the configured FlowDefinitionRegistry. 

기본 FlowUrlHandler 구현은 DefaultFlowUrlHandler입니다.

Expects URLs to launch flow to be of this pattern: 

    http://<host>/[app context path]/[app servlet path]/<flow path> 

    The flow id is treated as the path info component of the request URL string. 
    If the path info is null, the servletPath will be used as the flow id. Also, if 
    the servlet path ends in an extension it will be stripped when calculating the flow id. 
    The flow definition URL for the given flow id will be built by appending the 
    flow id to the base app context and servlet paths. 

경로 정보가 null되어 있어야합니다 및 서블릿 매핑이 같은 것을입니다 URI로 요청 '/ appContext/등록 /'에 대한 찾을 수 없습니다 흐름 매핑 : 결과/appContext/등록/* 흐름 ID는 등록되지 않은/appContext/registration /입니다. 서블릿 매핑을 확인하십시오.

0

MvcViewFactoryCreator 정의 및 .setViewFactoryCreator (mvcViewFactoryCreator)

을 제거하십시오.