|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
javax.faces.context Class FacesContextFactory
java.lang.Object javax.faces.context.FacesContextFactory
public abstract class FacesContextFactory
- extends Object
FacesContextFactory 是一个工厂对象,它创建(如果需要)并返回新的 FacesContext
实例,这些实例已经进行了初始化,以处理指定的请求和响应对象。实现可以调用分配的 FacesContext
实例的 release()
方法将其入池并回收,而不是每次都创建新的实例。
每个利用 JavaServer Faces 的 Web 应用程序都必须有一个 FacesContextFactory
实例。可以通过可移植的方式获取此实例,只需调用:
FacesContextFactory factory = (FacesContextFactory) FactoryFinder.getFactory(FactoryFinder.FACES_CONTEXT_FACTORY);
FacesContextFactory is a factory object that creates
(if needed) and returns new FacesContext
instances, initialized
for the processing of the specified request and response objects.
Implementations may take advantage of the calls to the
release()
method of the allocated FacesContext
instances to pool and recycle them, rather than creating a new instance
every time.
There must be one FacesContextFactory
instance per web
application that is utilizing JavaServer Faces. This instance can be
acquired, in a portable manner, by calling:
FacesContextFactory factory = (FacesContextFactory) FactoryFinder.getFactory(FactoryFinder.FACES_CONTEXT_FACTORY);
Constructor Summary | |
---|---|
FacesContextFactory()
|
Method Summary | |
---|---|
abstract FacesContext |
getFacesContext(Object context,
Object request,
Object response,
Lifecycle lifecycle)
Create (if needed) and return a FacesContext instance
that is initialized for the processing of the specified request
and response objects, utilizing the specified Lifecycle
instance, for this web application. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public
FacesContextFactory()
英文文档:
FacesContextFactory
public FacesContextFactory()
Method Detail |
---|
abstract public FacesContext
getFacesContext(Object context, Object request, Object response, Lifecycle lifecycle) throws FacesException
利用为此 Web 应用程序指定的 Lifecycle
实例创建(如果需要)并返回一个 FacesContext
实例,该实例已经进行了初始化,以处理指定的请求和响应对象。
此方法的实现必须确保,在对该实例调用 release()
方法之前,从调用此方法的线程调用 FacesContext
的 getCurrentInstance()
方法将返回相同的 FacesContext
实例。
context |
在 servlet 环境中,与此 Web 应用程序关联的 ServletContext |
request |
在 servlet 环境中,将要处理的 ServletRequest |
response |
在 servlet 环境中,将要处理的 ServletResponse |
lifecycle |
用来处理此请求的 Lifecycle 实例 |
Throws | FacesException:
如果无法为指定的参数构建 FacesContext |
Throws | NullPointerException:
如果有参数为 null |
getFacesContext
public abstract FacesContext getFacesContext(Object context, Object request, Object response, Lifecycle lifecycle) throws FacesException
Create (if needed) and return a
FacesContext
instance that is initialized for the processing of the specified request and response objects, utilizing the specifiedLifecycle
instance, for this web application.The implementation of this method must ensure that calls to the
getCurrentInstance()
method ofFacesContext
, from the same thread that called this method, will return the sameFacesContext
instance until therelease()
method is called on that instance.- Parameters:
context
- In servlet environments, theServletContext
that is associated with this web applicationrequest
- In servlet environments, theServletRequest
that is to be processedresponse
- In servlet environments, theServletResponse
that is to be processedlifecycle
- TheLifecycle
instance being used to process this request- Throws:
FacesException
- if aFacesContext
cannot be constructed for the specified parametersNullPointerException
- if any of the parameters arenull
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Submit a bug or feature
Copyright 2007 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms.
PS : 未经我党受权你也可自由散发此文档。 如有任何错误请自行修正;若因此而造成任何损失请直接找人民主席,请勿与本人联系。谢谢!