加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 创业 > C语言 > 正文

Jetty在WAR包中修改Context Path

发布时间:2020-12-15 00:37:56 所属栏目:C语言 来源:网络整理
导读:|-- Context Path --|-- Servlet Path -|--Path Info--| http://www.myserver.com /mywebapp /helloServlet /hello |-------- Request URI ----------------------------| Context Path + servlet path + path info = request uri For detail information,re
                        |-- Context Path --|-- Servlet Path -|--Path Info--| 
http://www.myserver.com /mywebapp             /helloServlet     /hello 
                        |-------- Request URI ----------------------------|

Context Path + servlet path + path info = request uri

For detail information,read

在Jetty中默认的 Context Path 是 war 包的名称,例如 mywebapp.war. 如果想修改 Context Path ,可以在 war 包中 web.xml 同级别的目录中加入 jetty-web.xml 文件,路径为: webapp/WEB-INF/jetty-web.xml, 内容如下:


这样设置以后,访问路径将会变成

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读