码迷,mamicode.com
首页 > 其他好文 > 详细

Interface ServletContext

时间:2014-09-29 12:36:41      阅读:149      评论:0      收藏:0      [点我收藏+]

标签:javax.servlet inter

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.

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

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.

The ServletContext object is contained within the ServletConfig object, which the Web server provides the servlet when the servlet is initialized. 

Interface ServletContext

标签:javax.servlet inter

原文地址:http://blog.csdn.net/hephec/article/details/39649689

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!