zoukankan      html  css  js  c++  java
  • servlet上下文接口(JDK)

    定义servlet用于与其servlet容器进行通信的一组方法,例如获取文件的MIME类型,调度请求或写入日志文件。
    每个Java虚拟机每个“Web应用程序”都有一个上下文。 (“Web应用程序”是安装在服务器的URL命名空间的特定子集下的servlet和内容的集合,如/ catalog,可能通过.war文件安装。)
    在其部署描述符中标记为“分布式”的Web应用程序的情况下,每个虚拟机将有一个上下文实例。 在这种情况下,上下文不能用作共享全局信息的位置(因为信息不是真正的全局信息)。 使用像数据库这样的外部资源。
    ServletContext对象包含在ServletConfig对象中,Web服务器在servlet初始化时提供servlet。

    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.

  • 相关阅读:
    Maximum Flow Exhaustion of Paths Algorithm
    ubuntu下安装java环境
    visualbox使用(二)
    vxworks一个超级奇怪的错误(parse error before `char')
    February 4th, 2018 Week 6th Sunday
    February 3rd, 2018 Week 5th Saturday
    February 2nd, 2018 Week 5th Friday
    February 1st, 2018 Week 5th Thursday
    January 31st, 2018 Week 05th Wednesday
    January 30th, 2018 Week 05th Tuesday
  • 原文地址:https://www.cnblogs.com/zhaoby451/p/7251157.html
Copyright © 2011-2022 走看看