Two Laptop Bag
The moose likes Tomcat and the fly likes context path 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 "context path in Tomcat 5.5" Watch "context path in Tomcat 5.5" New topic

context path in Tomcat 5.5

ManiRaj Raj

Joined: May 10, 2006
Posts: 1
How to set the context path in Tomcat5.5?
In Tomcat4.1 we set path in server.xml But here i couldn't find
context path in server.xml.
Please help me
Sonny Gill
Ranch Hand

Joined: Feb 02, 2002
Posts: 1211

Here you go mate -

The future is here. It's just not evenly distributed yet. - William Gibson
Sonny Gill LinkedIn
Satyam Jaiswal

Joined: May 23, 2006
Posts: 6
you need to go in "C:\Program Files\Apache Software Foundation\Tomcat 5.0\conf\Catalina\localhost" or where ever your "\conf\Catalina\localhost" and make a APPName.xml file, APPName may be anything. Content of the application would be
<Context path="/APPName" docBase=" path of the code" >

Thank You
Christophe Verré

Joined: Nov 24, 2005
Posts: 14688

APPName may be anything.

Actually, I think that APPName has to be the name of an existing application.

[My Blog]
All roads lead to JavaRanch
Mav Ricky
Ranch Hand

Joined: May 19, 2004
Posts: 76
even it could be like this as well

<Context path="/" docBase=" path of the code" >
Salvador Cecilio
Ranch Hand

Joined: Dec 20, 2004
Posts: 41
So how is Tomcat able to map out the location of the "jsp-examples" and "servlets-examples"?

I can't find their context tags in any of the tomcat xml files.

SCJP 1.4 - 93%
SCWCD 1.4 - 89%
IBM FileNet 3.5 - Developer
IBM FileNet 3.5 - Administrator
William Brogden
Author and all-around good cowpoke

Joined: Mar 22, 2000
Posts: 13037
So how is Tomcat able to map out the location of the "jsp-examples" and "servlets-examples"?

There is a built in convention that if a directory under webapps has a WEB-INF subdirectory and there is a correctly formatted web.xml there, then that directory is a web application. All according to the servlet API.

I agree. Here's the link:
subject: context path in Tomcat 5.5
It's not a secret anymore!