如何配置Spring WebSocket端点映射与JSF视图映射一起使用

时间:2018-11-30 10:36:32

标签: spring-mvc spring-webflow spring-websocket spring-faces

我的Web应用程序当前正在与JSF一起使用Spring Web Flow。当前配置使用FlowHandlerMapping和ViewResolver作为UrlBasedViewResolver,如下所示

public @Bean
FlowHandlerMapping flowHandlerMapping(FlowDefinitionRegistry flowDefinitionRegistry) {
    FlowHandlerMapping flowHandlerMapping = new FlowHandlerMapping();
    flowHandlerMapping.setFlowRegistry(flowDefinitionRegistry);
    flowHandlerMapping.setDefaultHandler(new UrlFilenameViewController());
    flowHandlerMapping.setOrder(1);
    return flowHandlerMapping;
}

public @Bean
FlowHandlerAdapter flowHandlerAdapter(FlowExecutor flowExecutor) {
    FlowHandlerAdapter flowHandlerAdapter = new JsfFlowHandlerAdapter();
    flowHandlerAdapter.setFlowExecutor(flowExecutor);
    return flowHandlerAdapter;
}

@Bean
public SimpleControllerHandlerAdapter simpleControllerHandlerAdapter() {
    return new SimpleControllerHandlerAdapter();
}

public @Bean
ViewResolver viewResolver() {
    UrlBasedViewResolver resolver = new UrlBasedViewResolver();
    resolver.setViewClass(JsfView.class);
    resolver.setPrefix("/jsf/");
    resolver.setSuffix(".xhtml");
    return resolver;
}

在web.xml中,我们仅配置FacesServlet。我很困惑,需要什么步骤才能为套接字映射端点提供服务。 任何人都可以体验到这种配置吗?

非常感谢

0 个答案:

没有答案