Reputation: 242
Basically I want to remove project name while I access my project in eclipse.
so currently when I want to access a link of my web-app I have to put it as localhost:8080/project_name/blah_blah_blah
But I want it accessible by just localhost:8080/blah_blah_blah
or say The project itself should be accessible by just localhost:8080
.
Through googling I found this URL issue with tomcat include project name but in my case my context root is as /
by default.
FYI: This is the only project I have in my Eclipse
Upvotes: 4
Views: 3040
Reputation: 242
For people who come across this problem too.
To explain deeply: First remember that eclipse uses server under eclipse project explorer
within its all configuration.
In order for you change your project path to something different, what you can do is to open server.xml
under Project Explorer -> Servers -> Tomcat vX.X ... -> server.xml
.
At the bottom of this file You should see this line Before End of </host
Tag:
<Context docBase="Duck" path="/Duck" reloadable="true" source="org.eclipse.jst.jee.server:Duck"/>
Notice: My project Name is Duck
.
Now in order for you to access your web-app without project name replace path="/Duck"
to just path="/"
or You can set it to any name you want.
Upvotes: 6