【发布时间】:2020-09-28 14:25:59
【问题描述】:
我正在使用JSF1.2。
我们正在打开两个标签 1 和标签 2,并且在所有标签都提交之前不会关闭会话。
这就是我正在尝试的 -
- 使用一些数据打开选项卡 1。
- 使用一些数据打开选项卡 2
依次提交tab1。它将导航到指定页面,然后加载 tab1 页面和 tab2 数据。
如果我打开并提交一个选项卡,那么它只会返回到定义的页面。
我觉得这是因为它在会话中创建和保存两个视图数据,并且每次都检查视图会话。
This is My bean class 看起来像 -
public class testbean {
public testbean() {
initilize();
}
private void initilize() {
Map<String, Object> session =
FacesContext.getCurrentInstance().getExternalContext().getSessionMap();
controller = getDataFromSession(session);
}
}
Face-config.xml
<managed-bean>
<managed-bean-name>testbean</managed-bean-name>
<managed-bean-class>com.test.testbean</managed-bean-class>
<managed-bean-scope>request</managed-bean-scope>
</managed-bean>
<navigation-case>
<from-action>#{testbean.submit}</from-action>
<from-outcome>Page4</from-outcome>
<to-view-id>/pages/Page4Post.jsp</to-view-id>
</navigation-case>
<navigation-case>
<from-action>#{testbean.submit}</from-action>
<from-outcome>Page3</from-outcome>
<to-view-id>/pages/Page3Post.jsp</to-view-id>
</navigation-case>
<navigation-case>
<from-action>#{testbean.submit}</from-action>
<from-outcome>Page1</from-outcome>
<to-view-id>/pages/page1Post.jsp</to-view-id>
</navigation-case>
<navigation-case>
<from-action>#{testbean.submit}</from-action>
<from-outcome>Page2</from-outcome>
<to-view-id>/pages/Page2Post.jsp</to-view-id>
</navigation-case>
我们使用自己的过滤器将数据保存到我们的地图中。
在特定于 Bean 的 test.jsp 中将表单提交到某个 JSF 页面并且该 JSF 页面正在关闭会话。
【问题讨论】:
-
通过迁移到 JSF 2.3...JSF 1.2 已经超过 10 年了...请参阅 How to Ask 关于 minimal reproducible example...虽然您可能对 JSF 2.3 有同样的问题
-
uhhhh....
private void initilize() { Map<String, Object> session = FacesContext.getCurrentInstance().getExternalContext().getSessionMap(); controller = getDataFromSession(session); }所以是的,您的 BEANS 可能是请求范围的,但您仍然共享会话数据... -
看看为什么发布代码是相关的
-
看到没有人可以帮助您...我很乐意(尝试)提供帮助,但确实需要minimal reproducible example...抱歉