javax.servlet.ServletContext翻译

2008-02-23 09:17:43来源:互联网 阅读 ()

新老客户大回馈,云服务器低至5折

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
Interface ServletContext


public interface ServletContext

Defines a set of methods that a servlet uses to communicate with its servlet container, for example, to get the MIME type of a file, dispatch requests, or write to a log file. 定义了一组方法,servlet用来和它的servlet容器通信,比如,获得文件的MIME类型,分配请求,或者输出日志文件。

There is one context per "Web application" per Java Virtual Machine. (A "web application" is a collection of servlets and content installed under a specific subset of the server's URL namespace such as /catalog and possibly installed via a .war file.) 每个Java虚拟机的每个web应用都会有一个context。(一个web应用是指安装在服务器的URL命名空间的子集下(比如/catalog)也有可能通过.war文件安装的一组 servlet和内容的组合)。

In the case of a web application marked "distributed" in its deployment descriptor, there will be one context instance for each virtual machine. In this situation, the context cannot be used as a location to share global information (because the information won't be truly global). Use an external resource like a database instead. 如果web应用在它的部署描述符中标记为“distributed”,那么每一个虚拟机将只有一个context实例。在这种情况下,context不会用来作为全球共享信息的地址(因为信息不可能真的全球共享),而是使用外部的资源,比如数据库来替代。

The ServletContext object is contained within the ServletConfig object, which the Web server provides the servlet when the servlet is initialized. ServletContext对象被包含于ServletConfig对象内,该对象由servlet初始化时web服务器提供给servlet。

Version:
$Version$
Author:
Various
See Also:
Servlet.getServletConfig(), ServletConfig.getServletContext()

Method Summary Object getAttribute(String name)
Returns the servlet container attribute with the given name, or null if there is no attribute by that name. 返回给定名称的的servlet容器属性,如果没有该名称的属性,返回null。
Enumeration getAttributeNames

标签:

版权申明:本站文章部分自网络,如有侵权,请联系:west999com@outlook.com
特别注意:本站所有转载文章言论不代表本站观点,本站所提供的摄影照片,插画,设计作品,如需使用,请与原作者联系,版权归原作者所有

上一篇:为什么要采用java这个平台?

下一篇:正则表达式分解SIEMENS交换机巡检-------(1)