Using JSF with multiple tabs in one browser
This question already has an answer here:
In JSF 2.0 you can use the view scope for this, annotable using @ViewScoped
. You can even define custom scopes.
See also:
@ViewScoped
I don't think View Scope will work here. The question is specifically about a multi-browser tab scenario and my understanding with View Scope is that there is still one separate state per view (not per tab). In other words if you have the same page open in multiple browser tabs then you are at risk for sharing state.
This is mentioned here: http://www.java.net/node/692109
It seems like there are only two solutions to this problem: 1. CDI/Seam conversation scope (or something like it where an extra id is added to requests) or 2. Just stick to request scope / stateless app.
MyFaces Orchestra有一种处理多个选项卡/窗口的方法(使用conversationContext
获取参数)。
上一篇: JSF会话管理和调整
下一篇: 在一个浏览器中使用带有多个选项卡的JSF