我目前正在使用Spring4 + Thymeleaf设置Web应用程序,现在我想使用html页面添加Spring Webflow功能。
当我调用它们的URL时会触发流,但是我总是会收到以下错误消息:
java.lang.IllegalArgumentException: Unsupported view type /WEB-INF/templates/test.html only types supported by this FlowViewResolver implementation are [.jsp] and [.jspx]
我添加了Java配置,以使用Thymeleaf Documentation中所述的自定义viewresolver:
@Bean
public MvcViewFactoryCreator mvcViewFactoryCreator() {
MvcViewFactoryCreator factoryCreator = new MvcViewFactoryCreator();
factoryCreator.setViewResolvers(
Collections.singletonList(thymeleafViewResolver));
factoryCreator.setUseSpringBeanBinding(true);
return factoryCreator;
}
@Bean
public ViewResolver thymeleafViewResolver() {
AjaxThymeleafViewResolver resolver = new AjaxThymeleafViewResolver();
resolver.setTemplateEngine(templateEngine());
resolver.setCharacterEncoding(UTF8);
resolver.setOrder(0);
return resolver;
}
当我调试呼叫时,我发现它不是配置中的viewResolver,而是Webflow使用默认的FlowResourceFlowViewResolver。
有人可以告诉我我所缺少的吗?如何将Spring / Webflow带入Thymeleaf解析器?