JSF-会话范围的Bean,由不同机器上的浏览器共享 [英] JSF - session scoped bean shared by browsers on different machines

查看:64
本文介绍了JSF-会话范围的Bean,由不同机器上的浏览器共享的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们有一个搜索表单,其中过滤器绑定到托管bean(会话范围)上的属性.它不是组件绑定,它的属性绑定类似于<h:inputText value="#{searchBean.filter}"/>.

We have a search form where the filter is bound to a property on a managed bean (session scope). It's not component binding, its property binding like <h:inputText value="#{searchBean.filter}"/>.

从不同机器(然后是不同的会话)提交的数据混合在一起.您搜索"john",并得到"mary",因为您旁边的那个人刚刚搜索了"mary".您的searchBean.filter的值是获取他的提交的数据,而不是您的数据.

Submitted data from different machines (different sessions, then) is getting mixed. You search "john", and get "mary" just because the guy beside you have just searched "mary". The value of your searchBean.filter is getting his submitted data instead of yours.

我已经搜索了很多东西,没有找到解决方案,只是

I've already googled around a lot and found no solution, just an ocurrence of the same problem.

有人遇到过这个问题吗?有任何线索吗?

Have anybody faced this issue already? Any clues?

谢谢!

推荐答案

这可能有两个原因:

  1. 该bean实际上在应用程序范围内.
  2. 所讨论的属性声明为 static .

要修复1),只需确保它在会话范围内即可.
要解决2),只需删除非法的修饰符即可.

To fix 1), just ensure that it's in session scope.
To fix 2), just remove the illegal modifier.

这篇关于JSF-会话范围的Bean,由不同机器上的浏览器共享的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆