如何使用jsf 2.0配置spring webflow?
我在将 JSF2.0 作为视图技术集成到 spring webflow 时遇到问题。 我设法让它“几乎”工作,唯一剩下的就是配置 JSF2.0 的 ajax 支持。
发送 Ajax 请求,接收来自服务器的响应,但响应不会触发组件的重新渲染。
几乎没有线索可以帮助解决问题:
当涉及到生成 .js 资源链接时,JSF 行为是错误的。 JSF 尝试访问以下链接:
http://localhost:8080/${context_path}/${flow_name}/javax.faces.resource/jsf.js?ln=javax.faces 这会返回 404。我必须在模板中对以下链接进行硬编码以获得一些 ajax 支持:
http://localhost:8080/${context-path}/javax .faces.resource/jsf.js.faces?ln=javax.faces(我在关闭 Web 流并调查普通 JSF 处理页面的源代码后找到了此链接)
我假设 JSF 的配置是正确的。如果我从处理链中删除网络流,一切都会按预期进行。链接正常,组件重新呈现正常
如果我将我的服务公开为@ManagedBean(JSF本机方法)并且不使用Spring支持的bean重新渲染工作正常,但我无法交互使用 webflow 和 flow 作用域变量(web-flow 看不到本机 @ManagedBeans),但我仍然必须使用硬编码链接。
我没有任何 Spring 资源 servlet/过滤器。我不使用 urlRewrite 规则转发到我的流。
如果需要配置文件 - 我会将它们发布在问题中。
任何帮助表示赞赏。看来这是使用整个技术栈的一个阻碍问题。
I have a problem integration JSF2.0 as a view technology to spring webflow.
I managed to get it "almost" working, the only thing left is configuring ajax support for JSF2.0.
Ajax requests are sent, responses from the server are received, but the response doesn't trigger re-rendering of the component.
Few clues to help to solve the problem:
When it comes to generating .js links to resources, JSF behavior is wrong. JSF tries to access the following link:
http://localhost:8080/${context_path}/${flow_name}/javax.faces.resource/jsf.js?ln=javax.faces
This gives 404 back. I had to hard-code the following link in the template to get some of the ajax support:http://localhost:8080/${context-path}/javax.faces.resource/jsf.js.faces?ln=javax.faces (I found this link after switching the web-flow off and investigating the source code of plain JSF processed page)
I assume, that the configuration of JSF is correct. If I drop the webflow from the processing chain, everything works as expected. Links are OK, re-rendering of the component is OK
If I expose my services as @ManagedBean (JSF native approach) and don't use Spring backed beans re-rendering works fine, but I'm not able to interact with webflow and flow scoped variables (web-flow doesn't see native @ManagedBeans) and still I have to use the hard-coded links.
I don't have any Spring resource servlet / filter. I don't use urlRewrite rules to forward to my flows.
If config files are required - I will post them in the question.
Any help is appreciated. Seems that this is a blocking issue of using the whole technology stack.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
步骤:1
web.xml
步骤:2
faces-config.xml
步骤:3
webflow-config.xml
步骤:4
webmvc-config.xml
Step :1
web.xml
Step: 2
faces-config.xml
Step: 3
webflow-config.xml
Step :4
webmvc-config.xml
最近,我在 spring webflow 项目中从 JSF 1 迁移到 JSF 2。后来我发现ajax不行。我在 webmvc-config.xml 中配置了这两个 bean
第一个 bean 是问题所在
你不能同时拥有它们。因此,请确保您只有 JsfFlowHandlerAdapter
以下是我的项目中的一些框架版本,以防万一
Recently I made a migration from JSF 1 to JSF 2 in a spring webflow project. Later I figured out that ajax doesn't work. I had these two beans configured in webmvc-config.xml
The first bean was the problem
You cant' have them both. So make sure you have only JsfFlowHandlerAdapter
Here are some framework versions in my project just in case