Apache Tomcat/5.0.27 file directory

Posted on 2005-03-22
Medium Priority
Last Modified: 2013-11-24
dear experts,

i could not figure out where to put my servlet and class file that will work.
i put all the jsp file under docroot which is at the same level as the tomcat directory under /www/(url).
inside the docroot, i create WEB-INF/classes/mypackage/, put all the java class in this directory.

please help. thanks.
Question by:sarahchi
  • 3
LVL 15

Expert Comment

ID: 13607692
Put your project under Tomcat_5.0\webapps.
The structure should be:
 your_app_folder\(*.html | *.jsp)
your_app_folder\WEB-INF\lib (jar files normally third party libraries)
your_app_folder\WEB-INF\classes  (any classes your project needs including compiled servlets)

The context of your application will be the name of your_app_folder (that can be changed though)
For more details or if you want to put the project elsewere see: http://www.onjava.com/pub/a/onjava/2001/04/19/tomcat.html
LVL 15

Expert Comment

ID: 13607763
You might want to look at: http://jakarta.apache.org/tomcat/tomcat-5.0-doc/appdev/deployment.html as well.
it is a summary of the file structure of your project and tomcat 5.0

Author Comment

ID: 13607765
but I am not allowed to create directory under webapps on the server
LVL 15

Accepted Solution

aozarov earned 440 total points
ID: 13607972
you can "war" it and then just put it there. war is the same compression as zip. so you can zip your_app_folder and then rename it to XXXX.war.
make sure you have web.xml in your WEB-INF.
If that is not acceptable as well then read the link above for more details. Basically you can either define a Context in server.xml or use the Deployer application.

Featured Post

Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Java contains several comparison operators (e.g., <, <=, >, >=, ==, !=) that allow you to compare primitive values. However, these operators cannot be used to compare the contents of objects. Interface Comparable is used to allow objects of a cl…
By the end of 1980s, object oriented programming using languages like C++, Simula69 and ObjectPascal gained momentum. It looked like programmers finally found the perfect language. C++ successfully combined the object oriented principles of Simula w…
Viewers will learn one way to get user input in Java. Introduce the Scanner object: Declare the variable that stores the user input: An example prompting the user for input: Methods you need to invoke in order to properly get  user input:
Viewers will learn about if statements in Java and their use The if statement: The condition required to create an if statement: Variations of if statements: An example using if statements:
Suggested Courses
Course of the Month7 days, 6 hours left to enroll

593 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question