如何从会话中清除所有 pageFlowScope 地图?
当我们确定不再需要它时,如何清除 pageFlowScopes 并从会话中查看缓存?
以下清除当前请求上下文中的 pageFlowScope
映射
RequestContext requestContext = RequestContext.getCurrentInstance();
requestContext.getPageFlowScope().clear();
,但如果我转储 http-session 属性
,我仍然在会话
org.apache.myfaces.trinidadinternal.application.PageFlowScope.ois6p8lk1
org.apache.myfaces.trinidadinternal.application.PageFlowScope.ois6p8lk2
org.apache.myfaces.trinidadinternal.application.PageFlowScope.ois6p8lk3
和视图缓存 中看到许多 PageFlowscopes
实例显然
org.apache.myfaces.trinidadinternal.application.VIEW_CACHE.1qvzgdgkw
org.apache.myfaces.trinidadinternal.application.VIEW_CACHE.2qvzgdgkw
org.apache.myfaces.trinidadinternal.application.VIEW_CACHE.3qvzgdgkw
,如果我清除会话属性,它就会消失,但我不想这样做,还有其他方法吗?
使用
- trinidad-api-1.0.10.jar
- myfaces-impl-1.1.5.jar
编辑
还观察到以下属性永远保留在会话中,并且内容随着时间的推移而增长
org.apache.myfaces.trinidadinternal.Change
How to clear pageFlowScopes and view caches from session when we are sure its no longer required?
Following clears pageFlowScope
map in current request context
RequestContext requestContext = RequestContext.getCurrentInstance();
requestContext.getPageFlowScope().clear();
But if I dump http-session attributes
I still see many instances of PageFlowscopes
in the session
org.apache.myfaces.trinidadinternal.application.PageFlowScope.ois6p8lk1
org.apache.myfaces.trinidadinternal.application.PageFlowScope.ois6p8lk2
org.apache.myfaces.trinidadinternal.application.PageFlowScope.ois6p8lk3
and view caches as well
org.apache.myfaces.trinidadinternal.application.VIEW_CACHE.1qvzgdgkw
org.apache.myfaces.trinidadinternal.application.VIEW_CACHE.2qvzgdgkw
org.apache.myfaces.trinidadinternal.application.VIEW_CACHE.3qvzgdgkw
Obviously if I clear session attributes it will all go away but I don't want to do that, Is there any other way ?
Using
- trinidad-api-1.0.10.jar
- myfaces-impl-1.1.5.jar
EDIT
Also observed following attribute is kept in session forever, and the content grows over time
org.apache.myfaces.trinidadinternal.Change
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
PageFlowScope
如果不打算使用多个 pageflowscope,可以更改
trinidad-config.xml
中的以下条目,这将控制
org.apache.myfaces.trinidadinternal.application 的数量.PageFlowScope
保持在会话中。VIEW_CACHE
如果不打算使用
VIEW_CACHE
,可以将web.xml
中的以下init params
配置为最小值。中保存的
org.apache.myfaces.trinidadinternal.application.VIEW_CACHE
数量的控制,这将保持对会话trinidadinternal.Change
我找不到避免这种情况的方法。
最终使用以下方法进行清理
PageFlowScope
If not planning to use multiple pageflowscopes following entry in
trinidad-config.xml
can be alteredThis will control number of
org.apache.myfaces.trinidadinternal.application.PageFlowScope
kept in session.VIEW_CACHE
If not planning to use
VIEW_CACHE
followinginit params
inweb.xml
can be configured to a minimal value.This will keep control over number of
org.apache.myfaces.trinidadinternal.application.VIEW_CACHE
kept in sessiontrinidadinternal.Change
I couldn't find a way to to avoid this.
Ended up using following method to cleanup