|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
javax.faces.webapp Class FacesServlet
java.lang.Object javax.faces.webapp.FacesServlet
- All Implemented Interfaces:
- Servlet
FacesServlet 是管理 Web 应用程序请求处理生命周期的 servlet,这些应用程序利用 JavaServer Faces 来构造用户界面。
FacesServlet is a servlet that manages the request processing lifecycle for web applications that are utilizing JavaServer Faces to construct the user interface.
Field Summary | |
---|---|
static String |
CONFIG_FILES_ATTR
Context initialization parameter name for a comma delimited list of context-relative resource paths (in addition to /WEB-INF/faces-config.xml which is loaded automatically
if it exists) containing JavaServer Faces configuration information. |
static String |
LIFECYCLE_ID_ATTR
Context initialization parameter name for the lifecycle identifier of the Lifecycle instance to be utilized. |
Constructor Summary | |
---|---|
FacesServlet()
|
Method Summary | |
---|---|
void |
destroy()
Release all resources acquired at startup time. |
ServletConfig |
getServletConfig()
Return the ServletConfig instance for this servlet. |
String |
getServletInfo()
Return information about this Servlet. |
void |
init(ServletConfig servletConfig)
Acquire the factory instances we will require. |
void |
service(ServletRequest request,
ServletResponse response)
Process an incoming request, and create the corresponding response, by executing the request processing lifecycle. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
英文文档:
CONFIG_FILES_ATTR
public static final String CONFIG_FILES_ATTR
Context initialization parameter name for a comma delimited list of context-relative resource paths (in addition to
/WEB-INF/faces-config.xml
which is loaded automatically if it exists) containing JavaServer Faces configuration information.- See Also:
- Constant Field Values
英文文档:
LIFECYCLE_ID_ATTR
public static final String LIFECYCLE_ID_ATTR
Context initialization parameter name for the lifecycle identifier of the
Lifecycle
instance to be utilized.- See Also:
- Constant Field Values
Constructor Detail |
---|
public
FacesServlet()
英文文档:
FacesServlet
public FacesServlet()
Method Detail |
---|
public void
destroy()
释放启动时获取的所有资源。
destroy
public void destroy()
public ServletConfig
getServletConfig()
返回此 servlet 的 ServletConfig
实例。
getServletConfig
public ServletConfig getServletConfig()
Return the
ServletConfig
instance for this servlet.- Specified by:
getServletConfig
in interfaceServlet
- Returns:
- the
ServletConfig
object that initializes this servlet - See Also:
Servlet.init(javax.servlet.ServletConfig)
public String
getServletInfo()
返回关于此 Servlet 的信息。
getServletInfo
public String getServletInfo()
Return information about this Servlet.
- Specified by:
getServletInfo
in interfaceServlet
- Returns:
- a
String
containing servlet information
public void
init(ServletConfig servletConfig) throws ServletException
获取将需要的工厂实例。
Throws | ServletException:
如果由于某种原因此 Faces 应用程序启动失败。这包括在处理此 init() 方法之前或期间解析的 config 文件中的错误。 |
init
public void init(ServletConfig servletConfig) throws ServletException
Acquire the factory instances we will require.
- Parameters:
servletConfig
- aServletConfig
object containing the servlet's configuration and initialization parameters- Throws:
ServletException
- if, for any reason, the startup of this Faces application failed. This includes errors in the config file that is parsed before or during the processing of thisinit()
method.- See Also:
UnavailableException
,Servlet.getServletConfig()
public void
service(ServletRequest request, ServletResponse response) throws java.io.IOException, ServletException
通过执行请求处理生命周期处理传入的请求,并创建相应的响应。
如果此方法的 request
和 response
参数分别不是 HttpServletRequest
和 HttpServletResponse
,则此方法的调用结果不确定。
此方法必须对以下列字符串开头的请求做出响应:对响应参数(强制转换为 HttpServletResponse
)调用 sendError
方法,并传递代码 HttpServletResponse.SC_NOT_FOUND
作为参数。
/WEB-INF/
/WEB-INF
/META-INF/
/META-INF
request | 正在处理的 servlet 请求 |
response | 正在创建的 servlet 响应 |
Throws | java.io.IOException: 如果处理期间发生输入/输出错误 |
Throws | ServletException: 如果处理期间发生 servlet 错误 |
service
public void service(ServletRequest request, ServletResponse response) throws IOException, ServletException
Process an incoming request, and create the corresponding response, by executing the request processing lifecycle.
If the
request
andresponse
arguments to this method are not instances ofHttpServletRequest
andHttpServletResponse
, respectively, the results of invoking this method are undefined.This method must respond to requests that start with the following strings by invoking the
sendError
method on the response argument (cast toHttpServletResponse
), passing the codeHttpServletResponse.SC_NOT_FOUND
as the argument./WEB-INF/ /WEB-INF /META-INF/ /META-INF
- Parameters:
request
- The servlet request we are processingresponse
- The servlet response we are creating- Throws:
IOException
- if an input/output error occurs during processingServletException
- if a servlet error occurs during processing
|
|||||||||
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 : 未经我党受权你也可自由散发此文档。 如有任何错误请自行修正;若因此而造成任何损失请直接找人民主席,请勿与本人联系。谢谢!