分享
 
 
 

javax.servlet.GenericServlet翻译

王朝java/jsp·作者佚名  2006-01-09
窄屏简体版  字體: |||超大  

[/url] [url=file:///F:/资料/文字资料/j2ee-1.4_doc/apidocs/overview-summary.html]Overview

Package

Class

Tree

Deprecated

Index

Help

JavaTM 2 Platform

Ent. Ed. v1.4

PREV CLASS NEXT CLASS

FRAMES NO FRAMES All Classes

SUMMARY: NESTED | FIELD | CONSTR | METHOD

DETAIL: FIELD | CONSTR | METHOD

javax.servlet

Class GenericServletjava.lang.Object

javax.servlet.GenericServlet

All Implemented Interfaces: Serializable, Servlet, ServletConfig Direct Known Subclasses: HttpServlet public abstract class GenericServlet extends Object implements Servlet, ServletConfig, SerializableDefines a generic, protocol-independent servlet. To write an HTTP servlet for use on the Web, extend HttpServlet instead. 定义了一个一般的,与协议无关的servlet。为了写一个HTTP servlet在Web上使用,应当继承HttpServlet。

GenericServlet implements the Servlet and ServletConfig interfaces. GenericServlet may be directly extended by a servlet, although it's more common to extend a protocol-specific subclass such as HttpServlet. GenericServlet实现了Servlet和ServletConfig接口。GenericServlet可以直接被servlet继承,尽管继承一个指定协议的子类比如HttpServlet更常用。

GenericServlet makes writing servlets easier. It provides simple versions of the lifecycle methods init and destroy and of the methods in the ServletConfig interface. GenericServlet also implements the log method, declared in the ServletContext interface. GenericServlet使得写servlet更容易。它提供了生命周期方法init、destroy和ServletConfig接口方法的简单版本。 GenericServlet也实现了在ServletContext接口中声明的log方法。

To write a generic servlet, you need only override the abstract service method. 写一个generic servlet,你只需要重写抽象方法service。

Version: $Version$ Author: Various See Also: Serialized FormConstructor Summary

GenericServlet()

Does nothing. 不做任何事。

Method Summary

void

destroy()

Called by the servlet container to indicate to a servlet that the servlet is being taken out of service. 由servlet容器调用,表示servlet正被清除出服务。

String

getInitParameter(String name)

Returns a String containing the value of the named initialization parameter, or null if the parameter does not exist. 返回命名的初始化参数的对应String值,如果参数不存在返回null。

Enumeration

getInitParameterNames()

Returns the names of the servlet's initialization parameters as an Enumeration of String objects, or an empty Enumeration if the servlet has no initialization parameters. 返回以String对象的Enumeration形式的servlet初始化参数名称,如果servlet不含初始化参数,返回一个空Enumeration。

ServletConfig

getServletConfig()

Returns this servlet's ServletConfig object. 返回servlet的ServletConfig对象。

ServletContext

getServletContext()

Returns a reference to the ServletContext in which this servlet is running. 返回正在运行的servlet的ServletContext的引用。

String

getServletInfo()

Returns information about the servlet, such as author, version, and copyright. 返回servlet的信息,例如作者、版本和版权。

String

getServletName()

Returns the name of this servlet instance. 返回servlet实例的名称。

void

init()

A convenience method which can be overridden so that there's no need to call super.init(config). 能被重写的简便方法,以至于不需调用super.init(config)。

void

init(ServletConfig config)

Called by the servlet container to indicate to a servlet that the servlet is being placed into service. 由servlet容器调用,表示servlet正被放入服务。

void

log(String msg)

Writes the specified message to a servlet log file, prepended by the servlet's name. 将详细信息写入servlet日志文件,含servlet名称。

void

log(String message, Throwable t)

Writes an explanatory message and a stack trace for a given Throwable exception to the servlet log file, prepended by the servlet's name. 将说明信息和给出的Throwable异常堆栈跟踪写入servlet日志文件,含servlet名称。

abstract void

service(ServletRequest req, ServletResponse res)

Called by the servlet container to allow the servlet to respond to a request. 由servlet容器调用,允许servlet响应请求。

Methods inherited from class java.lang.Object

clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

GenericServletpublic GenericServlet()

Does nothing. All of the servlet initialization is done by one of the init methods. 不做任何事。所有servlet初始化都由某个init方法完成。

Method Detail

destroypublic void destroy()

Called by the servlet container to indicate to a servlet that the servlet is being taken out of service. See Servlet.destroy(). 由servlet容器调用,表示servlet正被清除出服务。参见Servlet.destroy()。

Specified by: destroy in interface ServletgetInitParameterpublic String getInitParameter(String name)

Returns a String containing the value of the named initialization parameter, or null if the parameter does not exist. See ServletConfig.getInitParameter(java.lang.String). 返回命名的初始化参数的对应String值,如果参数不存在返回null。参见ServletConfig.getInitParameter(java.lang.String)。 This method is supplied for convenience. It gets the value of the named parameter from the servlet's ServletConfig object. 该方法为了简便起见提供,从servlet的ServletConfig对象中获得指定名称的参数值。

Specified by: getInitParameter in interface ServletConfigParameters: name - a String specifying the name of the initialization parameter String,指定初始化参数的名称 Returns: String a String containing the value of the initalization parameter 包含初始化参数值的StringgetInitParameterNamespublic Enumeration getInitParameterNames()

Returns the names of the servlet's initialization parameters as an Enumeration of String objects, or an empty Enumeration if the servlet has no initialization parameters. See ServletConfig.getInitParameterNames(). 返回以String对象的Enumeration形式的servlet初始化参数名称,如果servlet不含初始化参数,返回一个空Enumeration。参见ServletConfig.getInitParameterNames()。 This method is supplied for convenience. It gets the parameter names from the servlet's ServletConfig object. 该方法为了简便起见提供,从servlet的ServletConfig对象中获得参数名称。

Specified by: getInitParameterNames in interface ServletConfigReturns: Enumeration an enumeration of String objects containing the names of the servlet's initialization parameters String对象的枚举,包含初始化变量的名称getServletConfigpublic ServletConfig getServletConfig()

Returns this servlet's ServletConfig object. 返回servlet的ServletConfig对象。

Specified by: getServletConfig in interface ServletReturns: ServletConfig the ServletConfig object that initialized this servlet 初始化servlet的ServletConfig对象 See Also: Servlet.init(javax.servlet.ServletConfig)getServletContextpublic ServletContext getServletContext()

Returns a reference to the ServletContext in which this servlet is running. See ServletConfig.getServletContext(). 返回正在运行的servlet的ServletContext的引用。参见ServletConfig.getServletContext()。 This method is supplied for convenience. It gets the context from the servlet's ServletConfig object. 该方法为了简便起见提供,从servlet的ServletConfig对象中获得上下文。

Specified by: getServletContext in interface ServletConfigReturns: ServletContext the ServletContext object passed to this servlet by the init method 通过init方法传递给servlet的ServletContext对象 See Also: ServletContextgetServletInfopublic String getServletInfo()

Returns information about the servlet, such as author, version, and copyright. By default, this method returns an empty string. Override this method to have it return a meaningful value. See Servlet.getServletInfo(). 返回servlet的信息,例如作者、版本和版权。 默认返回空字符串。重写本方法,可以让它返回一个有意义的值。参见Servlet.getServletInfo()。

Specified by: getServletInfo in interface ServletReturns: String information about this servlet, by default an empty string 关于servlet的信息,墨认为空字符串initpublic void init(ServletConfig config)

throws ServletException

Called by the servlet container to indicate to a servlet that the servlet is being placed into service. See Servlet.init(javax.servlet.ServletConfig). 由servlet容器调用,表示servlet正被放入服务。参见Servlet.init(javax.servlet.ServletConfig)。 This implementation stores the ServletConfig object it receives from the servlet container for later use. When overriding this form of the method, call super.init(config). 该实现保存了从servlet容器接收到的ServletConfig对象留作后用。重写该方法时,应调用super.init(config)。

Specified by: init in interface ServletParameters: config - the ServletConfig object that contains configutation information for this servlet ServletConfig对象,包含servlet的配置信息 Throws: ServletException - if an exception occurs that interrupts the servlet's normal operation 如果异常发生,阻止servlet的正常操作时抛出 See Also: UnavailableExceptioninitpublic void init()

throws ServletException

A convenience method which can be overridden so that there's no need to call super.init(config). 能被重写的简便方法,以至于不需调用super.init(config)。 Instead of overriding init(ServletConfig), simply override this method and it will be called by GenericServlet.init(ServletConfig config). The ServletConfig object can still be retrieved via getServletConfig(). 代之重写init(ServletConfig),可以简单重写本方法,它将会被GenericServlet.init(ServletConfig config)调用。 ServletConfig对象仍然可以通过getServletConfig()获得。

Throws: ServletException - if an exception occurs that interrupts the servlet's normal operation 如果异常发生,阻止servlet的正常操作时抛出logpublic void log(String msg)

Writes the specified message to a servlet log file, prepended by the servlet's name. See ServletContext.log(String). 将详细信息写入servlet日志文件,含servlet名称。参见ServletContext.log(String)。

Parameters: msg - a String specifying the message to be written to the log file String,指定写入日志文件的信息logpublic void log(String message,

Throwable t)

Writes an explanatory message and a stack trace for a given Throwable exception to the servlet log file, prepended by the servlet's name. See ServletContext.log(String, Throwable). 将说明信息和给出的Throwable异常堆栈跟踪写入servlet日志文件,含servlet名称。参见ServletContext.log(String, Throwable)。

Parameters: message - a String that describes the error or exception 描述错误或异常的String t - the java.lang.Throwable error or exception java.lang.Throwable错误或异常servicepublic abstract void service(ServletRequest req,

ServletResponse res)

throws ServletException,

IOException

Called by the servlet container to allow the servlet to respond to a request. See Servlet.service(javax.servlet.ServletRequest, javax.servlet.ServletResponse). 由servlet容器调用,允许servlet响应请求。参见Servlet.service(javax.servlet.ServletRequest, javax.servlet.ServletResponse)。 This method is declared abstract so subclasses, such as HttpServlet, must override it. 该方法被声明为抽象,所以子类,比如HttpServlet必须重载它。

Specified by: service in interface ServletParameters: req - the ServletRequest object that contains the client's request 包含客户端请求的ServletRequest对象 res - the ServletResponse object that will contain the servlet's response 包含客户端响应的ServletResponse对象 Throws: ServletException - if an exception occurs that interferes with the servlet's normal operation occurred 如果异常发生,阻止servlet的正常操作时抛出 IOException - if an input or output exception occurs 如果输入输出异常发生时抛出getServletNamepublic String getServletName()

Returns the name of this servlet instance. See ServletConfig.getServletName(). 返回servlet实例的名称。 参见ServletConfig.getServletName()。

Specified by: getServletName in interface ServletConfigReturns: the name of this servlet instance servlet实例名称[/url][url=file:///F:/资料/文字资料/j2ee-1.4_doc/apidocs/overview-summary.html]Overview

Package

Class

Tree

Deprecated

Index

Help

JavaTM 2 Platform

Ent. Ed. v1.4

PREV CLASS NEXT CLASS

FRAMES NO FRAMES All Classes

SUMMARY: NESTED | FIELD | CONSTR | METHOD

DETAIL: FIELD | CONSTR | METHOD

Submit a bug or feature Copyright 2003 Sun Microsystems, Inc. All rights reserved.

 
 
 
免责声明:本文为网络用户发布,其观点仅代表作者个人观点,与本站无关,本站仅提供信息存储服务。文中陈述内容未经本站证实,其真实性、完整性、及时性本站不作任何保证或承诺,请读者仅作参考,并请自行核实相关内容。
2023年上半年GDP全球前十五强
 百态   2023-10-24
美众议院议长启动对拜登的弹劾调查
 百态   2023-09-13
上海、济南、武汉等多地出现不明坠落物
 探索   2023-09-06
印度或要将国名改为“巴拉特”
 百态   2023-09-06
男子为女友送行,买票不登机被捕
 百态   2023-08-20
手机地震预警功能怎么开?
 干货   2023-08-06
女子4年卖2套房花700多万做美容:不但没变美脸,面部还出现变形
 百态   2023-08-04
住户一楼被水淹 还冲来8头猪
 百态   2023-07-31
女子体内爬出大量瓜子状活虫
 百态   2023-07-25
地球连续35年收到神秘规律性信号,网友:不要回答!
 探索   2023-07-21
全球镓价格本周大涨27%
 探索   2023-07-09
钱都流向了那些不缺钱的人,苦都留给了能吃苦的人
 探索   2023-07-02
倩女手游刀客魅者强控制(强混乱强眩晕强睡眠)和对应控制抗性的关系
 百态   2020-08-20
美国5月9日最新疫情:美国确诊人数突破131万
 百态   2020-05-09
荷兰政府宣布将集体辞职
 干货   2020-04-30
倩女幽魂手游师徒任务情义春秋猜成语答案逍遥观:鹏程万里
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案神机营:射石饮羽
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案昆仑山:拔刀相助
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案天工阁:鬼斧神工
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案丝路古道:单枪匹马
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案镇郊荒野:与虎谋皮
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案镇郊荒野:李代桃僵
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案镇郊荒野:指鹿为马
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案金陵:小鸟依人
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案金陵:千金买邻
 干货   2019-11-12
 
推荐阅读
 
 
 
>>返回首頁<<
 
靜靜地坐在廢墟上,四周的荒凉一望無際,忽然覺得,淒涼也很美
© 2005- 王朝網路 版權所有