Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
The moose likes Tomcat and the fly likes How to define the default context ? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Products » Tomcat
Bookmark "How to define the default context ?" Watch "How to define the default context ?" New topic
Author

How to define the default context ?

Jay Damon
Ranch Hand

Joined: Jul 31, 2001
Posts: 282
I have installed Eclipse 3.4 and Tomcat 5.5.26 with the Sysdeo plugin and have gotten everything to work correctly with a simple web app. The problem is that, in order to get things to work correctly, I had to define a specific web context, e.g. "\Test", for my Tomcat project context. However, I want my web app to be the default web app using "\" as the context.

There is a default Tomcat web app that currently responds to the default context but, being relatively new to Tomcat, I am unable to determine exactly where it is declared. I found my web app's context file, e.g. Test.xml, in C:\Apache\tomcat-5.5.26\conf\Catalina\localhost along with others name admin.xml, host-manager.xml and manager.xml but the default context does not appear to be declared in any of these files or in server.xml.

I have reviewed the documentation at Tomcat site but I still don't see the answer. I am obviously overlooking something but at this point I am unable to see it. Can someone provide some clues as to how to make my web app the default web app? Thanks!
Dave Wingate
Ranch Hand

Joined: Mar 26, 2002
Posts: 262
I'm sure that there's a way to update the tomcat configuration xml files to change the root web application, but I can never remember how ... so I cheat. The default configuration of tomcat associates the root context with webapps/ROOT, so I usually create a symbolic link from webapps/ROOT to whichever webapp I want to be the root. I'm sure this is not the best way to get the job done, but it definitely works and is easy to do.


Fun programming etcetera!
Jay Damon
Ranch Hand

Joined: Jul 31, 2001
Posts: 282
Nevermind. Found and removed the problem web app named ROOT from Tomcat webapps folder and reset my web app context to "/".
Jay Damon
Ranch Hand

Joined: Jul 31, 2001
Posts: 282
Thanks David for your response. We must have posted at the same time but I essentially came with your solution.
 
Consider Paul's rocket mass heater.
 
subject: How to define the default context ?
 
Similar Threads
Replacing "Welcome to Tomcat" as Default
Servlet reloading
Is WEB-INF Directory mandatory ?
Session ID
apache tomcat manager problem