在Eclipse中更改Web项目的Tomcat上下文路径 [英] Changing Tomcat context path of web project in Eclipse
问题描述
- 更新了Context部分中的server.xml路径值
从
<上下文docBase =foobar path =/ foobaroadable =truesource =org.eclipse.jst.j2ee.server:foobar/>< / Host>
至
< Context docBase =foobarpath =/ appoadable =truesource =org.eclipse.jst.j2ee.server:foobar/>< / Host>
-
我更新了文件conf / Catalina / localhost / foobar .xml设置path =/ app和docBase =foobar,没有运气。
-
我试图删除Eclipse中的模块,并重新部署至少十几次。
- p>我在这里提出了建议:如何在Eclipse中更改动态Web项目的上下文根?
我知道我可以简单地重命名该项目,但我不想。
编辑:
我在应用程序上下文中有一些数据库设置。我不确定是否应该设置为foobar.xml或app.xml ..? Eclipse会自动在conf / Catalina / localhost中创建一个app.xml文件,但在进行更改后似乎被忽略。
- 在项目属性中,单击
Web项目设置
(假设您处于动态Web项目中)。唯一的配置值是Context root: - 将上下文根更改为/ app
- rebuild
- 从tomcat中删除项目
-
- 重新部署。
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
<Context docBase="foobar" path="/foobar" reloadable="true" source="org.eclipse.jst.j2ee.server:foobar"/></Host>
To
<Context docBase="foobar" path="/app" reloadable="true" source="org.eclipse.jst.j2ee.server:foobar"/></Host>
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 went through the suggestions here: How to change context root of a dynamic web project in Eclipse?
I know that I can simply rename the project, but I don't want to.
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.
这篇关于在Eclipse中更改Web项目的Tomcat上下文路径的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!