Understanding the Request Processing Lifecycle Phases
来源:互联网 发布:菜鸟网络 股东 编辑:程序博客网 时间:2024/06/05 11:26
The Lifecycle object processes a JSF request (encapsulated in the FacesContext object; the FacesContext is the object that is read and modified by Lifecycle during processing) in six phases, executed in the following order:
Reconstitute Component Tree
A JSP page in a JSF application is represented by a component tree. This phase starts the Lifecycle request processing by constructing this tree. Each component tree has an identifier that is unique throughout the application. The identifier of a component tree is the path information portion of the request URI. For a request with the URI /faces/index.jsp, for instance, the tree identifier is /index.jsp. The constructed component tree is then saved in the FacesContext object for processing by the following request processing phases.
Apply Request Values
In this phase, the local value of each component in the component tree is updated from the current request. A value can come from a request parameter, a header, a cookie, and so on. During this phase, a component may queue events. These events will be processed during the process event steps in the request processing lifecycle.
Process Validations
After the local value of each component is updated, in the Process Validations phase, the Lifecycle object will validate those values if necessary. A component that requires validation must provide implementation of the validation logic. Alternatively, a JSF programmer can register zero or more validators with the component. If one or more external validators are found, the local value of each component will be validated using the validation logic in these external validators.
Update Model Values
This phase can be reached only if the local values of all components in the tree are valid. In this phase, the Lifecycle object updates the application’s model data. During this phase, a component may again queue events.
Invoke Application
During this phase, the JSF implementation handles any application level events, such as submitting a form or linking to another page.
Render Response
In this phase, the JSF implementation renders the response to the client.
The Apply Request Values, Process Validations, Update Model Values, and Invoke Application phases in the request processing lifecycle may queue events in the FacesContext instance associated with the current request. Therefore, the JSF implementation must handle these events after these phases.
Between two phases, the Lifecycle object checks any event listener that needs to be called. When writing an event listener, you can choose after which phase the listener should be executed. Alternatively, you can write an event listener that is called after various phases.
Reconstitute Component Tree
A JSP page in a JSF application is represented by a component tree. This phase starts the Lifecycle request processing by constructing this tree. Each component tree has an identifier that is unique throughout the application. The identifier of a component tree is the path information portion of the request URI. For a request with the URI /faces/index.jsp, for instance, the tree identifier is /index.jsp. The constructed component tree is then saved in the FacesContext object for processing by the following request processing phases.
Apply Request Values
In this phase, the local value of each component in the component tree is updated from the current request. A value can come from a request parameter, a header, a cookie, and so on. During this phase, a component may queue events. These events will be processed during the process event steps in the request processing lifecycle.
Process Validations
After the local value of each component is updated, in the Process Validations phase, the Lifecycle object will validate those values if necessary. A component that requires validation must provide implementation of the validation logic. Alternatively, a JSF programmer can register zero or more validators with the component. If one or more external validators are found, the local value of each component will be validated using the validation logic in these external validators.
Update Model Values
This phase can be reached only if the local values of all components in the tree are valid. In this phase, the Lifecycle object updates the application’s model data. During this phase, a component may again queue events.
Invoke Application
During this phase, the JSF implementation handles any application level events, such as submitting a form or linking to another page.
Render Response
In this phase, the JSF implementation renders the response to the client.
The Apply Request Values, Process Validations, Update Model Values, and Invoke Application phases in the request processing lifecycle may queue events in the FacesContext instance associated with the current request. Therefore, the JSF implementation must handle these events after these phases.
Between two phases, the Lifecycle object checks any event listener that needs to be called. When writing an event listener, you can choose after which phase the listener should be executed. Alternatively, you can write an event listener that is called after various phases.
- Understanding the Request Processing Lifecycle Phases
- request processing lifecycle
- What are the phases of the maven default lifecycle?
- What are the phases of the maven default lifecycle?
- request processing lifecycle phase1 restore view
- jsf in action 笔记:请求处理的生命周期(The Request Processing Lifecycle)--2008.04.08
- Agile default lifecycle phases
- Maven: Build lifecycle and Phases and Goals
- The Unspoken - Phases of CMS
- Understanding HTTP Request Throttling
- Sys.WebForms.PageRequestManagerServerErrorException: An unknown error occurred while processing the request on the server. The s
- Sys.WebForms.PageRequestManagerServerErrorException: An unknown error occurred while processing the request on the server. The s
- Sys.WebForms.PageRequestManagerServerErrorException: An unknown error occurred while processing the request on the server. the s
- Sys.WebForms.PageRequestManagerServerErrorException: An unknown error occurred while processing the request on the server. The s
- 严重: An exception or error occurred in the container during the request processing
- Error: Sys.WebForms.PageRequestManagerServerErrorException: An unknown error occurred while processing the request on the server
- Sys.WebForms.PageRequestManagerServerErrorException: An unknown error occurred while processing the request on the server.
- An unknown error occurred while processing the request on the server
- python学习--StringIO
- 简单工厂模式+反射来改进抽象工厂模式
- 开发者如何提升和推销自己
- autorelease pool 和 Runloop的理解
- A. Lunch Rush
- Understanding the Request Processing Lifecycle Phases
- JDBC连接SQL Server2005错误:通过端口 1433 连接到主机 localhost 的 TCP/IP 连接失败
- boost库在工作(15)绑定器与函数对象之三
- ubuntu中软件安装相关知识(deb、dpkg、apt-get)
- 燕十八php垃圾回收机制学习之第一天
- LR检查点
- JavaScript如何实现3秒自动跳转
- solr 4.1 怎么开启suggest
- Solr查询相识度最高排序