• 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

Tomcat 4 and 5, Servlet Configuration Difference

 
Ranch Hand
Posts: 78
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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:

 
Author and all-around good cowpoke
Posts: 13078
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 1392
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
William and Joyce

Really thank you for yor help.

Regards,
Mac
 
reply
    Bookmark Topic Watch Topic
  • New Topic