FacesServlet (Java EE 5)

Java EE API


javax.faces.webapp Class FacesServlet

java.lang.Object
  extended by javax.faces.webapp.FacesServlet
All Implemented Interfaces:
Servlet

public final class FacesServlet
extends Object
implements Servlet

Implements: 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
static String
 
Constructor Summary
 
Method Summary
 void
 ServletConfig
 String
 void
 void
 
Methods inherited from class java.lang.Object
 

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()

Release all resources acquired at startup time.

Specified by:
destroy in interface Servlet

public ServletConfig getServletConfig()

返回此 servlet 的 ServletConfig 实例。

英文文档:

getServletConfig

public ServletConfig getServletConfig()

Return the ServletConfig instance for this servlet.

Specified by:
getServletConfig in interface Servlet
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 interface Servlet
Returns:
a String containing servlet information

public void init(ServletConfig servletConfig) throws ServletException

获取将需要的工厂实例。

ThrowsServletException: 如果由于某种原因此 Faces 应用程序启动失败。这包括在处理此 init() 方法之前或期间解析的 config 文件中的错误。
英文文档:

init

public void init(ServletConfig servletConfig)
          throws ServletException

Acquire the factory instances we will require.

Specified by:
init in interface Servlet
Parameters:
servletConfig - a ServletConfig 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 this init() method.
See Also:
UnavailableException, Servlet.getServletConfig()

public void service(ServletRequest request, ServletResponse response) throws java.io.IOException, ServletException

通过执行请求处理生命周期处理传入的请求,并创建相应的响应。

如果此方法的 requestresponse 参数分别不是 HttpServletRequestHttpServletResponse,则此方法的调用结果不确定。

此方法必须对以下列字符串开头的请求做出响应:对响应参数(强制转换为 HttpServletResponse)调用 sendError 方法,并传递代码 HttpServletResponse.SC_NOT_FOUND 作为参数。

    
    /WEB-INF/
    /WEB-INF
    /META-INF/
    /META-INF
    
request 正在处理的 servlet 请求
response 正在创建的 servlet 响应
Throwsjava.io.IOException: 如果处理期间发生输入/输出错误
ThrowsServletException: 如果处理期间发生 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 and response arguments to this method are not instances of HttpServletRequest and HttpServletResponse, 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 to HttpServletResponse), passing the code HttpServletResponse.SC_NOT_FOUND as the argument.

    
    /WEB-INF/
    /WEB-INF
    /META-INF/
    /META-INF
    

Specified by:
service in interface Servlet
Parameters:
request - The servlet request we are processing
response - The servlet response we are creating
Throws:
IOException - if an input/output error occurs during processing
ServletException - if a servlet error occurs during processing


Submit a bug or feature

Copyright 2007 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms.

一看就知道只有菜鸟才干这么无知的事啦。

PS : 未经我党受权你也可自由散发此文档。 如有任何错误请自行修正;若因此而造成任何损失请直接找人民主席,请勿与本人联系。谢谢!