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)

  • 相关阅读:
    qmake Manual (EN) 1
    {转}linux gcc gdb使用
    qmake 简介
    {转}linux makefile 详细教程
    {转}Linux下C开发之——gcc,gdb的使用
    关于“做一个聊天+信息分享客户端”的设想(SNS?)
    {转}算法的力量
    hdu 2047 简单递推公式
    RONOJ 6 金明的预算方案
    hdu 2446 二分搜索解题报告
  • 原文地址:https://www.cnblogs.com/codetime/p/5325509.html
Copyright © 2011-2022 走看看