Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to define the default context ?

 
Jay Damon
Ranch Hand
Posts: 282
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 262
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Jay Damon
Ranch Hand
Posts: 282
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 282
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks David for your response. We must have posted at the same time but I essentially came with your solution.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic