• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Tomcat 4 and 5, Servlet Configuration Difference

 
Siamak Saarmann
Ranch Hand
Posts: 78
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,

1- I am trying to use Tomcat5 for servlet container to run examples. I
create a directory in webapps directory and put a web.xml inside its WEB-INF
directory.

This configuration of servlet works on Tomcat4 but not on Tomcat5. What is
the difference between two versions?

2- I can only run examples by creating a new context from inside Tomcat5
admin panel. But I can not find where it has written the configuration. (I
search the Tomcat5 directory for any file which contains my contexts'
directory but windows can not find any file). Where does Tomcat5 write
config for new contexts?

I appereciate your help.

Regards,
Mac



---
These are the instructions I follow:

1 Copy the HelloWorldServlet.class file to the directory

c:\tomcat4.0.1\webapps\chapter01\WEB-INF\classes

2 Create a text file named web.xml in the
c:\tomcat4.0.1\webapps\chapter01\WEB-INF directory. Write the following
lines in the file:

 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13055
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Your servlet class needs to be in a package. As a general rule, ALL classes used in servlets should be in a package and the location of the class files under WEB-INF/classes needs to reflect the package.
Tomcat 4.0.1 had the "invoker" turned on by default, this stopped somewhere in the middle of Tomcat4 releases. Read the Javaranch Invoker servlet FAQ.
Bill
 
Joyce Lee
Ranch Hand
Posts: 1392
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Siamak,

You can also check out CoreServlets.com.

Joyce
 
Siamak Saarmann
Ranch Hand
Posts: 78
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
William and Joyce

Really thank you for yor help.

Regards,
Mac
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic