tomcat文件路径更换,在Eclipse中更改Web项目的Tomcat上下文路径

本文描述了如何在使用Eclipse和Tomcat6时修改项目的上下文路径,以便URL从http://localhost:8080/foobar更改为http://localhost:8080/app。尝试了更新server.xml和foobar.xml文件中的路径设置,但未成功。解决方案是在项目属性的Web项目设置中更改上下文根为/app,然后重新构建并重新部署项目。
摘要由CSDN通过智能技术生成

I'm using Tomcat 6 and using the Servers functionality in Eclipse to manage it. I have a project named foobar and I'd like to change the context path so that the URLs referenced are http://localhost:8080/app instead of http://localhost:8080/foobar. I've tried everything that I can think of:

Updated the server.xml path value in the Context section

From

To

I updated the file conf/Catalina/localhost/foobar.xml to set the path="/app" and docBase="foobar" with no luck.

I tried to remove the Module in Eclipse and redeploy at least a dozen times.

I know that I can simply rename the project, but I don't want to.

OIBkk.png

EDIT:

I also should mention that I have some db settings in the application context. I am unsure if this should be set to foobar.xml or app.xml..? Eclipse automatically creates an app.xml file in conf/Catalina/localhost, but it seems to be ignored after I make changes.

解决方案In project properties click on Web Project Settings (assuming you are in a dynamic web project.) The only configuration value there is "Context root:"

change "Context root" to /app

rebuild

remove the project from tomcat

redeploy.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值