• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

I need to create a different directory to host my servlets class files in TOMCAT 4.0

 
Ranch Hand
Posts: 120
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have my servlets working in the examples directory but I need to create the directory
C:\myapp\iwa\servlets
I set the context in server.xml
<Context path="/myapp/iwa/servlets" docBase="myapp/iwa/servlets" debug="0" reloadable="true"/>
it does not find the servlet when I post to it.
currently the context below:
<!-- Tomcat Examples Context -->
<Context path="/examples" docBase="examples" debug="0" reloadable="true">
I can run my servlets placing all my class file servlets here without no problems.
but,I need to change the directory structure to use
C:\jakarta-tomcat-4.0\webapps\myapp\iwa\servlets
thanks in advance

------------------
Sun Certified Java Programmer
Sun Certified Java Developer
I-Net Certified
A+ Certified
Network+ Certified
MCP
 
Saloon Keeper
Posts: 27763
196
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I think you'll have better luck if you put an absolute filesystem path in the docBase attribute. By default, I believe it's relative to TOMCAT_HOME/webapps. "docBase" can be any directory, BTW, docBase doesn't have to form its name relative to the URL path. Though consistency does make it easier to maintain.
 
Ranch Hand
Posts: 3695
IntelliJ IDE Java Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Tim, you are right.

docBase is relative to the Tomcat/webapps directory unless you fully specify an absolute path.

So Ray, your docBase should say: "c:\myapp\iwa\servlets"
If it doesn't, Tomcat appends "c:\jakarta-tomcat-4.0\webapps\", which is why it runs from that path, but not the other.
 
reply
    Bookmark Topic Watch Topic
  • New Topic