zoukankan      html  css  js  c++  java
  • tomcat <context path>的意义及作用

    context path 是在tomcat 要支持多个应用时对每个应用的docBase做区别时的区分符。

    打个比方假如你有两个请求:一个为 http:localhost:8080/test1/helloworld  另外一个为 http:localhost:8080/test2/helloworld

    这时候你的

         第一个请求 context的配置为 <context path="test1" docBase="~/Documents/web1/" reloadable = true>

         第二个请求的 context的配置为 <context path="test2" docBase="~/Documents/web2/" reloadable = true>

    第一个请求的path为 "test1",其对应的docBase路径是~/Documents/web1/,tomcat服务器在接收到请求后就会从这个~/Documents/web1/路径去调用某个class的用来处理请求 http:localhost:8080/test1/ 这种格式url请求

    请求的path为 "test2",其对应的docBase路径是~/Documents/web2/,tomcat服务器在接收到请求后就会从这个~/Documents/web2/路径去调用某个class的用来处理请求 http:localhost:8080/test2/ 这种格式url请求

    (假如你没有指定path,但是指定了docBase的时候这时候你访问的url不用带/path 就可以访问到docBase的服务了,如<context path="" docBase="~/Documents/web1/" reloadable = true>,访问url:http:localhost:8080/helloworld)

  • 相关阅读:
    osg编译日志
    MFC加载大型osg模型
    osg gdal加载tif数据文件
    osg创建灯光
    ubuntu挂载新硬盘
    MFC加载osg模型
    nginx中Geoip_module模块的使用
    centos中释放缓存的方法
    python连接kafka生产者,消费者脚本
    python初始化环境记录
  • 原文地址:https://www.cnblogs.com/codetime/p/5325509.html
Copyright © 2011-2022 走看看