File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Tomcat and the fly likes changing ROOT in Tomcat 5.5 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » Tomcat
Bookmark "changing ROOT in Tomcat 5.5" Watch "changing ROOT in Tomcat 5.5" New topic

changing ROOT in Tomcat 5.5

Alexey Gor

Joined: Jul 13, 2004
Posts: 27
I read a lot about this but nothing seems to work. Strange that there is not a lot of info on this seemingly popular topic.

I want my context to be displayed when I hit http://localhost:8080. I'd like to do it without having to deploy my application as ROOT.

Let's say I have a web all called alexey.war

How can I make http://localhost:8080/ equivalent to http://localhost:8080/alexey/

How can I make http://localhost:8080/someURI/morestuff/? equivalent to http://localhost:8080/alexey/someURI/morestuff/?

Here is what I tried:
context.xml in my app with
<Context path="" docBase="alexey" debug="0" reloadable="true">

Some other stuff too... I really want to do this without having to change ROOT stuff or name of my context. Documentation says that empty path string (path="") should replace ROOT context with my app but that does not seem to work. I searched and there is no ohter path="" anywhere in Tomcat... thanks!
Alexey Gor

Joined: Jul 13, 2004
Posts: 27
nevermind, looks like I did it...

I tried this before but not it works for some reason. I added that <context> tag to server.xml.... putting it in a separate context.xml as recommended did not seem to work. There are probably other things that prevent it from working... I probably just took one of them out at some point... oh well...
I agree. Here's the link:
subject: changing ROOT in Tomcat 5.5
It's not a secret anymore!