问题描述
默认情况下,JSF 看起来非常有状态".我需要允许人们使用我们的应用程序,在应用程序的不同部分做很多事情.
By default JSF appears to be very 'stateful'. I need to allow people to use our application with multiple tabs doing many things in different parts of the application.
如果不进行大量的重新设计,我似乎无法找到有关如何实现这一点的正确说明.
I can't seem to find decent instruction on making this happen without a whole lot of re-engineering.
我们目前不使用 ICEfaces,但我刚刚在 ICEfaces 文档中找到了这个:
We do not currently use ICEfaces, but I just found this in the ICEfaces docs:
6.5.7.ICEfaces Portlet 和并发 DOM 视图
ICEfaces 提供了一个名为控制的并发 DOM 视图无论是 ICEfaces 框架支持单个视图的多个视图来自同一浏览器的应用程序.在 portlet 容器中运行时,ICEfaces 需要单独对待单个门户页面上的 portlet 作为不同的观点所以它几乎总是有必要(因此最安全)将此参数设置为 true.
ICEfaces provides a feature called Concurrent DOM Views that controls whether or not the ICEfaces framework supports multiple views of a single application from the same browser. When running in a portlet container, ICEfaces needs to treat the separate portlets on a single portal page as distinct views so it is almost always necessary (and therefore safest) to have this parameter set to true.
例 6.19.启用 ICEfaces并发 DOM 视图功能WEB-INF/web.xml 配置文件等将相同的 portlet 分开门户页面被视为不同的观看次数
Example 6.19. Enabling the ICEfaces Concurrent DOM Views feature in the WEB-INF/web.xml configuration file so that separate portlets on the same portal page are treated as distinct views
com.icesoft.faces.concurrentDOMViews真的
com.icesoft.faces.concurrentDOMViews true
那么,我想知道这个美妙的声音功能是否可能适用于我现有的 h:forms 或者它是否只适用于 ICEface 组件?
So, I want to know whether this fabulous sounding functionality would possibly apply to my existing h:forms or whether it only works with ICEface components?
谁能提供任何好的建议来让 JSF 应用程序在多个选项卡中工作?
Can anyone offer any good advice to get a JSF app working in multiple tabs?
推荐答案
在 JSF 2.0 中,您可以为此使用 视图范围,使用 @ViewScoped
.您甚至可以定义自定义范围.
In JSF 2.0 you can use the view scope for this, annotable using @ViewScoped
. You can even define custom scopes.
这篇关于在一个浏览器中使用带有多个选项卡的 JSF的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!