wood burning stoves*
The moose likes Tomcat and the fly likes set up context path Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » Products » Tomcat
Bookmark "set up context path " Watch "set up context path " New topic
Author

set up context path

Tony Lavalle
Ranch Hand

Joined: Jan 18, 2005
Posts: 36
Ok quick question I have a folder on c: this is where I am saving all the files that are created for my jsp class, but how do I set the context path. Since this folder is outside the tomcat directory. the book we, plus the instructor aren't very clear on this.
Tony Lavalle
Ranch Hand

Joined: Jan 18, 2005
Posts: 36
oh almost forgot the context path looks like this.

<Context path="/myapp"
docBase="c:\myjspapp"
debug="0"
reloadable="true" />

where would i put this.
Rahul Singh Khokhar
Ranch Hand

Joined: Feb 23, 2005
Posts: 36
For that folder on your C:\ drive, the context name also need to be the same i.e. 'myjspapp'

So, it should be something like this in your server.xml
<Context path="/myjspapp"
docBase="c:/myjspapp"
debug="0"
reloadable="true" />
Tony Lavalle
Ranch Hand

Joined: Jan 18, 2005
Posts: 36
I am using tomcat 5.5.7 so where abouts in the server.xml?
Tony Lavalle
Ranch Hand

Joined: Jan 18, 2005
Posts: 36
i figured it out i needed to put a file i will call it myapp.xml in the %catalina_home%\conf\cataina\localhost.

plus i need to add it to my workers2properties file in the apache server to work. thanks for the ideas.
Rahul Singh Khokhar
Ranch Hand

Joined: Feb 23, 2005
Posts: 36
I assumed you were using Tomcat 4.x as your Tomcat version wasn't mentioned earlier. Anyway, now that you have found the solution, in the older Tomcat 4.x & 3.x the context were added to the server.xml. You can do the same in Tomcat 5.5.7 but to tidy the things up with your webapps the new Tomcat places a file each for every context in the <catalina_home>\conf\Catalina\localhost folder.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: set up context path