首页 技术 正文
技术 2022年11月16日
0 收藏 459 点赞 5,151 浏览 764 个字

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)

相关推荐
python开发_常用的python模块及安装方法
adodb:我们领导推荐的数据库连接组件bsddb3:BerkeleyDB的连接组件Cheetah-1.0:我比较喜欢这个版本的cheeta…
日期:2022-11-24 点赞:878 阅读:9,492
Educational Codeforces Round 11 C. Hard Process 二分
C. Hard Process题目连接:http://www.codeforces.com/contest/660/problem/CDes…
日期:2022-11-24 点赞:807 阅读:5,907
下载Ubuntn 17.04 内核源代码
zengkefu@server1:/usr/src$ uname -aLinux server1 4.10.0-19-generic #21…
日期:2022-11-24 点赞:569 阅读:6,740
可用Active Desktop Calendar V7.86 注册码序列号
可用Active Desktop Calendar V7.86 注册码序列号Name: www.greendown.cn Code: &nb…
日期:2022-11-24 点赞:733 阅读:6,494
Android调用系统相机、自定义相机、处理大图片
Android调用系统相机和自定义相机实例本博文主要是介绍了android上使用相机进行拍照并显示的两种方式,并且由于涉及到要把拍到的照片显…
日期:2022-11-24 点赞:512 阅读:8,132
Struts的使用
一、Struts2的获取  Struts的官方网站为:http://struts.apache.org/  下载完Struts2的jar包,…
日期:2022-11-24 点赞:671 阅读:5,295