Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
361 views
in Technique[技术] by (71.8m points)

java - deploy webapp from Eclipse to Tomcat root context

I deploy a .war application from Eclipse by adding the "Dynamic Web Module" facet, then right-clicking on the project and selecting "Run As -> Run on Server".

This works great, but by default the project is deployed to the /web context of Tomcat, because the project name is web. Is there a way I can deploy from Eclipse to Tomcat without changing the project name to ROOT?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

You need to go to Server View.. double click on tomcat, this opens a new window (with 2 tabs). Select the one which says Modules, your application would be listed there (with the context path). You can change the context path from /web to anything else from here.

Alternatively, you can open server.xml look for a tag called context. within this tag you'll find the contextroot as /web.. change it.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...