File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

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

 
Ray Smilgius
Ranch Hand
Posts: 120
  • 0
  • Mark post as helpful
  • send pies
  • 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
 
Tim Holloway
Saloon Keeper
Pie
Posts: 17622
39
Android Eclipse IDE Linux
  • 0
  • Mark post as helpful
  • send pies
  • 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.
 
Mike Curwen
Ranch Hand
Posts: 3695
IntelliJ IDE Java Ubuntu
  • 0
  • Mark post as helpful
  • send pies
  • 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.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic