JSF 没有会话超时。有什么缺点?
我在 WAS7.0 上有一个小型 JSF Web 应用程序,只有一个页面,但有相当大的用户群。
我可以将 all(1) beans 声明为请求范围,并使用 javax.faces.STATE_SAVING_METHOD 客户端,而不会在使用未过期会话的服务器上遇到内存问题吗?
对于更大的应用程序来说,这将如何工作?
原因:当 IBM 处理我的 PMR 时,我正在尝试快速解决 WAS7.0 中的问题。
编辑:此时我没有资源来尝试自己测量它,并且会保留应用程序原样(希望不要惹恼太多用户)。
I have a small JSF web application on WAS7.0 with just one page but a fairly large user base.
Can i declare all(1) beans as request scope and also use javax.faces.STATE_SAVING_METHOD client without running into memory issues on the server using a non expiring session?
How would that work for larger applications?
Reason: I am trying to work around an issue in WAS7.0 quickly while IBM deals with my PMR.
Edit: At this point i do not have the resources to try and measure it myself and would leave the app as is (hoping not to annoy too many users).
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您不一定需要更改 bean 的范围。只需将 Bean 保留在它们所属的范围内即可。只有当您滥用会话范围 Bean 来保存请求或查看范围数据时,情况才会真正发生变化。请求或视图范围的数据属于请求或视图范围的 Bean,而不是会话范围的 Bean。会话范围的 bean 应该仅用于保存会话范围的数据,例如登录的用户、其站点范围的首选项、所选的语言等。
将状态保存方法从服务器更改为客户端肯定会修复
ViewExpiredException
对于支持会话已过期的视图。它将减少服务器的内存使用量,但会增加服务器的网络带宽使用量。但如果您已经在使用 GZIP(或者尚未使用;因此也将其打开),那么影响就相当小了。You don't necessarily need to change the bean's scope. Just keep the beans in the scope they belong in. Only if you're abusing session scoped beans to hold request or view scoped data, then the story indeed changes. Request or view scoped data belongs in request or view scoped beans, not session scoped beans. The session scoped beans should only be used to hold session wide data, such as the logged-in user, its site-wide preferences, the chosen language, etc.
Changing the state saving method from server to client will definitely fix the
ViewExpiredException
on views whose backing session is been expired. It will decrease server's memory usage but it will increase server's network bandwidth usage. But if you're already using GZIP (or weren't already; so turn it on as well), then the impact is pretty minor.