FacesContext的作用是什么? [英] What is FacesContext used for?

查看:641
本文介绍了FacesContext的作用是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

FacesContext的用途是什么?

它在哪里实现?

解决方案

当请求处理生命周期时 JSF已经完成 实现将调用发布 方法,它提供了JSF 实现机会 释放任何获得的资源,因为 以及收集和回收 FacesContext实例而不是 为每个请求创建新请求.

在类 javax.faces.context.FacesContext <中指定/a>和在Mojarra中实现的 FacesContext和ExternalContext有什么区别

What is FacesContext used for?

And where exactly is it implemented?

解决方案

Quote from chapter 6.1 of JSF 2.0 specification:

FacesContext

JSF defines the javax.faces.context.FacesContext abstract base class for representing all of the contextual information associated with processing an incoming request, and creating the corresponding response.

A FacesContext instance is created by the JSF implementation, prior to beginning the request processing lifecycle, by a call to the getFacesContext method of FacesContextFactory, as described in Section 6.6 "FacesContextFactory".

When the request processing lifecycle has been completed, the JSF implementation will call the release method, which gives JSF implementations the opportunity to release any acquired resources, as well as to pool and recycle FacesContext instances rather than creating new ones for each request.

It is specified in class javax.faces.context.FacesContext and in Mojarra implemented in class com.sun.faces.context.FacesContextImpl and in MyFaces implemented in class org.apache.myfaces.context.servlet.FacesContextImpl.

See also:

这篇关于FacesContext的作用是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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