pageFlowScope、backingBeanScope、viewScope、applicationScope、sessionScope、requestScope
来源:互联网 发布:怎么卸载java环境 编辑:程序博客网 时间:2024/05/22 12:38
sessionScope: The object is available for the duration of the session.
requestScope: The object is available for the duration between HTTP requests until a response is sent back to the client.
In addition to the standard JSF scopes, ADF Faces provides the following scopes:
pageFlowScope: The object is available as long as the user continues navigating from one page to another. If the user opens a new browser window and begins
navigating, that series of windows will have their own pageFlowScope scope.
backingBeanScope: This is used for managed beans for page fragments and declarative components only. The object is available for the duration between HTTP requests until a response is sent back to the client. This is needed because there may be more than one page fragment or declarative component on a page,and to avoid collisions between values, any values must be kept in separate scope instances. Therefore, any managed bean for a page fragment or declarative component must use backingBeanScope scope.
viewScope: The object is available until the ID for the current view changes. Use viewScope scope to hold values for a given page. While requestScope scope
can be used to store a value needed from one page to the next, anything stored in viewScope scope will be lost once the view ID changes.
在以往的应用开发过程中,后端的业务组件(Action/Service/Dao),可以被设置为几种作用域:request、session、application。我们不可能把与每次请求关系很强的一些信息(例如某个列表页面要列出来的数据集合)简单的放到session里面去,这就导致了每次请求之间的大部分数据是不可能共享的。使用JSF,我们实现了一种叫做view的作用域,在不同的请求之间共享信息。
新版的spring中提出了一个conversation作用于,也是介于request和session之间的一个作用于,和seam中的conversation应该差不多。
view作用域是生命周期介于request和session之间的一个作用范围。当一个Spring Bean(一般来说是Action层面的Bean)被标注作用域为view的时候,Spring会在需要用到这个Bean的时候创建之,然后,在当前页面没有发生整页的reload、跳转的情况下,这个bean一直存在。所谓整页reload、跳转说的就是我们普通的表单提交,URL GET请求。发生除此之外的其他请求(目前能想到的其实也就是一种:Ajax请求)的时候,前面创建出来的bean对象一直存在。
我们在一个列表页面加载的时候,使用一个view作用域的bean作为其action对象,于是加载完成后,要对列表中的某些行执行操作的时候,你都不需要再次去查询,因为整个对象集合都依然存在!
本质上讲,view作用域中的数据时被放在了session中。但是JSF实现了对于这写内容的管理方式,不需要使用人员关心。
- pageFlowScope、backingBeanScope、viewScope、applicationScope、sessionScope、requestScope
- pageFlowScope、backingBeanScope、viewScope、applicationScope、sessionScope、requestScope
- pageFlowScope、backingBeanScope、viewScope、applicationScope、sessionScope、requestScope
- pageScope、requestScope、sessionScope、applicationScope的区别
- 4.EL入门:pageScope、requestScope、sessionScope 和applicationScope
- JSF作用域范围:SessionScope和RequestScope
- applicationScope
- El sessionScope
- requestScope含义
- ${sessionScope.XXX}
- ${requestScope}不显示值
- sessionScope取值问题
- [ActiveRecord] 之三:SessionScope
- request、requestScope、param区别
- struts2使用sessionScope失效
- request和requestScope区别
- request和requestScope区别
- ${sessionScope.user}失效
- GAR路由器的基本操作
- 自我的救赎
- poj1504 Adding Reversed Numbers
- MVC结构
- GAR路由器静态路由实验
- pageFlowScope、backingBeanScope、viewScope、applicationScope、sessionScope、requestScope
- poj 3685 Matrix (二分+枚举+二分)
- 分享一个易企CMS在线客服
- 2014年去哪儿网校园招聘笔试题
- 无法解析的外部符号 _main,该符号在函数 ___tmainCRTStartup 中被引用
- GAR路由器RIP实验
- NGINX-RTMP复杂度分析
- 工作那些事(三)什么样的公司能吸引你,什么样的公司适合你?
- 排序算法