JSF State最初保存到服务器&会话超时转移到客户端? [英] JSF State Saving initially to server & on session timeout transfer to client?

查看:219
本文介绍了JSF State最初保存到服务器&会话超时转移到客户端?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否有任何状态保存方法允许JSF应用程序在服务器上初始保存状态数据但在会话到期时间间隔之后,该状态将转移到客户端,以便即使在服务器和放大器上的会话超时之后,应用程序也始终响应;内存在服务器上管理得更好?

Are there any state saving method that would allow JSF application to intially save state data on server but after the session expire time interval , that state is transferred to client so that app is always responsive even after the session timeout on the server & memory is better managed on server?

或者这可以实现吗?但我希望这应该是JSF规范的一部分!

Or any way this could be implemented? But I expect that this should be a part of the JSF specification !

在BalusC提出建议后,我对 无状态JSF 原则&它目前的实施情况。如果其他任何人也对将无状态JSF添加到JSF规范感兴趣,请考虑查看或投票这个问题

After suggestion by BalusC, I'm highly impressed with the Stateless JSF principles & the current implementation for it. If anyone else here is also interested in stateless JSF being added to the JSF spec, consider having a look at or voting this issue.

无状态JSF为某些支付提供了巨大的性能提升,例如无法动态创建视图(例如通过绑定,JSTL标记等)或修改它。

Stateless JSF offers huge performance boosts for some payoffs like inability to create views dynamically (e.g. by binding, JSTL tags, etc), or modifying it.


无状态JSF操作模式
对于高负载应用程序和$ b $非常有用b架构:

A Stateless JSF operation mode would be incredibly useful for high-load applications and architectures:

http://industrieit.com/blog/2011/11/stateless-jsf-high-performance-zero-per-request-memory-overhead/#comment -4

以前Jacob建议:
http://weblogs.java.net/blog/jhook/archive/2006/01/experiment_goin.html

This has previously been suggested by Jacob: http://weblogs.java.net/blog/jhook/archive/2006/01/experiment_goin.html

这将有助于JSF放弃慢速和记忆力的耻辱,而b $ b有助于跟上当前的科技趋势s(无状态架构。)

This would help JSF ditch the stigma of "slow and memory hog," and help keep up with current tech trends (stateless architectures.)


推荐答案

技术上如何可行?如果下一个请求将创建新会话,则服务器永远不能可靠地预测,因此当前请求的响应必须使用客户端状态保存而不是服务器端状态保存。如果您使用普通的JSP / Servlet成功实现它,请随意发布JSF规范增强请求。

How is that technically possible? The server can never reliably predict beforehand if the next request would create a new session and thus the response of the current request has to use client side state saving instead of server side state saving. If you ever succeed to implement it using plain JSP/Servlet, feel free to post a JSF specification enhancement request.

只需使用客户端状态保存并确保部分状态保存已启用。与完全状态保存相比,开销相对较小。

Just use client side state saving and make sure that partial state saving is enabled. The overhead is relatively minor as compared to full state saving.

请注意,可以完全使用无状态的JSF。另请参见此博客。唯一的主要收益是你不能动态创建视图(例如通过绑定,JSTL标签等),也不能在创建后操纵它(例如通过添加/删除组件的子项)。

Note that it's possible to use JSF entirely stateless. See also this blog. The only major payoff is that you can't create views dynamically (e.g. by binding, JSTL tags, etc), nor manipulate it after creation (e.g. by adding/removing component's children).

  • Why JSF saves the state of UI components on server?

这篇关于JSF State最初保存到服务器&会话超时转移到客户端?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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